Filter Enum value list with text value

Hi all this is my first time using appsheet so please bare with me as I try to explain my problem.

Currently, my appsheet has a Bootstrap table containing user email and manager email. The objective is that users are able to select manager email on a dropdown list via enum selection. 

However, manager have two types: (1) Senior Manager and (2) General Manager. In this case, I would have user select TWO enum list, one for senior manager and one for general manager.

This is where I encountered a problem, the current table does not have a separate column to identify whether [Manager] (the  column for manager email) is senior manager or general manager. Therefore, if user tries to select manager, all manager emails will display.

I tried using the following formula to filter general managers by comparing a TEXT value to filter ENUM list: 

IFS(
CONTAINS(BOOTSTRAP[Org Title], "General"),
BOOTSTRAP[Manager]
)

You may have already guessed it by now, but this formula does not work in the enum list for selecting general manager since I am comparing a LIST with a TEXT value. 

Does anyone have a solution or alternative workaround to this problem?  Your help is greatly appreciated ๐Ÿ˜‰

Solved Solved
0 6 2,934
1 ACCEPTED SOLUTION

I see now that I made a syntax error in the example I offered in my earlier reply, but I think it's still the same technique that you need, i.e., using SELECT or a similar function. In the Valid if property for the [Reviewer Name (General Manager/Senior General Manager)] column, define the list of valid values using an expression like the following, where BOOTSTRAP is the name of the AppSheet table that includes the [Manager] and [Org Title] columns. Based on your sample data, it looks like you could also use LEFT or STARTSWITH instead of CONTAINS.

SELECT(BOOTSTRAP[Manager], CONTAINS([Org Title], "General"))

 

View solution in original post

6 REPLIES 6

If you're constructing a Valid if expression to define a list of values to be selectable in an enum field, you might need something like the following. See SELECT.

SELECT(BOOTSTRAP[Manager], CONTAINS(BOOTSTRAP[Org Title], "General"))

 

Thank for the prompt reply. This expression doesn't filter list for managers with general manager title. Instead, It will select all managers in the list if it CONTAINS text value "General". 

Note: I am using custom table for testing purposes... 

I don't understand what you're trying to accomplish nor your data structure. Try posting screenshots of the pertinent table column lists and column settings.

test.png

As you can see, I have two ENUM list for managers. One is the "Reviewer Name (Senior/Manager)" and the second is "Reviewer Name (General Manager/Senior General Manager)."

Untitled.png

Both ENUMs will show this list. My objective is to filter the second ENUM list to only show managers when their designation contains the text fragment value of "General"

Untitled2.png

I hope this helps... I have created a custom table "User List" for the purpose of testing this feature. 

I see now that I made a syntax error in the example I offered in my earlier reply, but I think it's still the same technique that you need, i.e., using SELECT or a similar function. In the Valid if property for the [Reviewer Name (General Manager/Senior General Manager)] column, define the list of valid values using an expression like the following, where BOOTSTRAP is the name of the AppSheet table that includes the [Manager] and [Org Title] columns. Based on your sample data, it looks like you could also use LEFT or STARTSWITH instead of CONTAINS.

SELECT(BOOTSTRAP[Manager], CONTAINS([Org Title], "General"))

 

Thank you, it finally work.