Valid If to filter an Enum of Ref

This column is an Enum of Ref
This is my default Valid If : 

IN(
[Type of Error],
FILTER(
"Types_of_error",
[_THISROW].[Level of Error] = [Level of Error]
)
)

This filter correctly what I need
But I have a behavior that change the value but I get this error : "Action Failed Type of Error is invalid"

So I want to bypass the Valid If
So I make this : 

IF(
Context("ViewType") = "Form",
IN(
[Type of Error],
FILTER(
"Types_of_error",
[_THISROW].[Level of Error] = [Level of Error]
)
),
TRUE
)

But the problem is in my dropdown of my form view, the filter is no longer active
Can someone help me please ?

0 2 165
2 REPLIES 2

Can you show us the "Types_of_error" table?  

Are you trying to implement a Dropdown list for the column OR perform validation on the entered value? 

In a Valid_If, if your expression returns a list of values, AppSheet will deduce that you are attempting to provide a Dropdown list of valid values.  However, the list must be of appropriate type. in the case of an Enum/Ref type column, the list MUST be a list of Ref values - i.e. a list of row keys from the source table.  No validation is needed because a user can choose ONLY the values in the list.

If in your Valid_If, your expression returns True/False values, AppSheet will deduce that you want to perform validation on the entered value.  There will be no dropdown.  This is typically used to verify a manually entered value meets criteria.

If all you want is a list of the types of errors that user chooses from, then you probably only need this expression:

FILTER(
"Types_of_error",
[_THISROW].[Level of Error] = [Level of Error]
)

The FILTER() function returns a list of row keys be default.  The next common problem is that the dropdown using the expression above doesn't display the desired values.  This is controlled by setting the Label on that table - in your case, on the "Types_of_error" table.  Set as the "Label:, the column that contains that value you wished displayed.  AppSheet will handle it for you.

 

Table "Types_of_error"

Name (Text)Level of Error (Ref)Type of Sanction (Ref)

Table "Levels_of_error"

Name (Text)

Table "Types_of_sanction"

Name (Text)

I tried with the expression that you give me but my button do the same error : 
"Action Failed Type of Error is invalid"

Top Labels in this Space