What Expression to use to auto select Enum value

Hello all

New to appsheet and still learning it’s expressions.

I have a column [SHUTTLE] with Yes or No buttons, now I wish to trigger an action when Yes is selected, and the Action is to automatically select 1 of the 3 “values” I have on Column [PAGAMENTO] which is and Enum field.

I guess the expression should be written in the Formula at the [SHUTTLE] ?

Thank you
Daniel

2 Likes

Thank you Austin,
I have been through the App formulas guide.
But I can’t seem to find the expression to auto select one of the values (buttons) of the enum column.

I was trying this formula but it doesn’t work
IF([SHUTTLE]=YES,[PAGAMENTO]=CREDITO,[PAGAMENTO]=CASH)

Can someone help me out,
Thanks

It appears what you want to do is auto-select the initial value of the PAGAMENTO column according to the value of the SHUTTLE column. There are several possible approaches according to how you want your app to behave.

  1. If the goal is to suggest the payment type, but allow the user to chose another if they want, put the following expression in the Initial value setting for the PAGAMENTO column:

    IF([SHUTTLE], "CREDITO", "CASH")
    
  2. If the goal is to require the payment type, and not allow the user to chose method, put the same expression from (1) above into the App formula setting instead, for the PAGAMENTO column.

2 Likes

Once again, great answer Steve.

I got it easily done, just as I wanted :slight_smile:

Thank you

1 Like