Reset the ref value in case the parent ref changes

Hello community, when we are adding records in a form it happens that sometimes we are choosing between categories, subcategories and items and those choices may be of the child type.

For example, we choose country, province and then city.

It turns out that we are choosing the country, then the province and finally the city but, we discover that we have made a mistake in choosing the country and we change it, however, the province and the city have remained unchanged.

I think that something useful would be to be able to "reset the ref value" in case the parent ref changes and not have to do it manually.

Greetings

Status Open
0 4 181
4 Comments
FJSA
Bronze 3
Bronze 3

Valid If 

Ifs (
([Country]="England"), select(England[ID], true, false),
([Country]="France"), list(),
([Country]="Spain"), list())

If u take England, you can take the citys of England, but if u change the country, the city of England remove.

What you're suggesting is great, I hadn't thought about it. I'm going to try to do that. Thank you.

Hello, I wanted to tell you that I have tried, but the row value is not reset, although it changes, the expected behavior does not occur. Thank you anyway.

FJSA
Bronze 3
Bronze 3

This expression utilizes the Ifs() function to set conditions based on the value of the "Country" column. Here's the breakdown:

 

If the "Country" is "England," it uses the select() function to retrieve a list of values from the "ID" column of the "England" table. It allows any value for "ID" that is true and excludes those that are false.

 

If the "Country" is "France," an empty list (list()) is returned, indicating that no values are allowed.

 

If the "Country" is "Spain," it also returns an empty list (list()).

 

In summary, this Valid If expression conditions the validity of values based on the selected country. For "England," it allows specific "ID" values; for "France" and "Spain," it doesn't allow any values, making entries with these countries considered invalid.