Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Emunlist with numerical values asigned

Hi Appsheet Community

I am using Appsheet to cover issues with COVID-19. In my form I have a questions with enumlist answers e.g.:

Did you visit same public places?
Bank | Restaurants | Hospital | Supermarkt | No

I would like to assign a numeric value to each option according to the risk and add the values in a Virtual Column. It with other VC will compute the actual status the caller e.g.:

Low Risk | Medium Risk | High Risk

I hope you can help me with these issue,

Luis

Solved Solved
0 4 222
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

The App formula expression for your virtual column might look something like this:

SUM(
  LIST(
    IFS(IN("Bank", [enumlist-column]), 1),
    IFS(IN("Restaurants", [enumlist-column]), 1),
    IFS(IN("Hospital", [enumlist-column]), 1),
    IFS(IN("Supermarket", [enumlist-column]), 1),
    ...
    IFS(IN("No", [enumlist-column]), 0)
  )
)

Replace enumlist-column with the name of the EnumList column. The number at the end of each line is the value you want used for that like’s choice.

View solution in original post

4 REPLIES 4

Steve
Platinum 5
Platinum 5

The App formula expression for your virtual column might look something like this:

SUM(
  LIST(
    IFS(IN("Bank", [enumlist-column]), 1),
    IFS(IN("Restaurants", [enumlist-column]), 1),
    IFS(IN("Hospital", [enumlist-column]), 1),
    IFS(IN("Supermarket", [enumlist-column]), 1),
    ...
    IFS(IN("No", [enumlist-column]), 0)
  )
)

Replace enumlist-column with the name of the EnumList column. The number at the end of each line is the value you want used for that like’s choice.

Hi Steve,

I really appreciate your support. It works perfekt

Thank you

can we done this with switch function?

Possibly, but it depends on how your data is structured. SWITCH() would not be appropriate for the data given in the original request.

Top Labels in this Space