Drop Down List with If Statement

Hi,
Iโ€™m new with Appsheet and I would like to know how to use the DropDown list with an IF statement.
That Iโ€™m trying to do is:

Exercise 1:
If value โ€œAโ€ is 1, then show me this dropdown list
If value โ€œAโ€ is 2, then show me this dropdown list

Exercise 2:
If value โ€œAโ€ is 1, then show me this dropdown list
If value โ€œAโ€ is 2, then show me this dropdown list

Someone can help me?

Thanks in advance,

0 9 755
9 REPLIES 9

Try this to start with

Hi,
Iโ€™ve tried and first exercise is ok but when I try to do the same with the second exercise, I canโ€™t chose the value โ€œAโ€ from the dropdown list, it appears the same value that Iโ€™ve chosen on the exercise 1.

Please, find attached a screenshot from my screen.
I canโ€™t chose SC, Stretching or Mobility but I donโ€™t know where is the issue. I used the dependent dropdown list. Maybe is because I used the same expression on the exercise 1 and exercise 2?

That seems to be the problem but itโ€™s not actually accurate neither.

Post your config and we will be able to help you with that.
Make sure you havenโ€™t made the second exercise dependent from the first one, since thatโ€™s not what you need.

Make sure you havenโ€™t made the second exercise dependent from the first one, since thatโ€™s not what you need โ†’ yes, I did that. What Iโ€™ve to do then if I want to have another dropdown list from the same values I had on the exercise 1?

Post your config and we will be able to help you with that. โ†’ How can I share my configuration?

Thanks,

Just make dependent the columns that need to listen to other ones in order to show โ€˜filtered optionsโ€™.
Since you need to always show the 3 exercise options you mentioned, just leave those exercise columns as enum with no other arguments.
By โ€˜post your configโ€™ I mean show us a screenshot of the configuration, showing the expressions you are using






Please, find attached the 6 steps I did.

Iโ€™ve tried to remove the first step: exercises[workout focus] and Iโ€™ve created an enum list with the 3 values but it doesnโ€™t work, the next row doesnโ€™t recognize the 3 values to create a dependent dropdown.

As far as I can see, Workout Focus doesnโ€™t need any Valid If expression, just make it Enum type with the 3 options. Jount Focus is the one that needs the valid if. Also, I see you are using Valid_If to create a dropdown list, making AppSheet to do itโ€™s magic in order to make the dependent dropdown, but since you have more than one in your form, I encourage you to do it manually instead of relly on automatic behaviour.

Iโ€™m sorry if Iโ€™m not giving you a copy and paste solution but I feel I would be doing no good for you with such kind of help.
I just would want to point you to make a suggested values expression instead of Valid_If since you will be giving the user just the options that are computed via buttons and the user wonโ€™t add values anyway. You could also refine it using Show_If expressions, but thatโ€™s another item by itโ€™s own.

In summary, I would make the first column an enum type with the 3 options that you have or making it dynamically using Suggested Values (UNIQUE(Exercises[Exercise]) so that the options will grow as you add more exercises. Then make another Suggested Values Expression to create the options for โ€œWorkout focusโ€ dependent from the value thatโ€™s inside [_THISROW].[E1]

Thatโ€™s my opinion, generally there are more than just one way of doing things in AppSheet

PS: Could you please show us your Exercises table schema?

Please find the schema of Exercises table

Thanks for your help. Iโ€™m reading all the links that you gave me but for the moment I canโ€™t manage to create the correct dropdown list for the Exercise 2.

There's a way, just write you formula in "Initial Value" and you can edit your dropdown list anytime.

Top Labels in this Space