Is there a cut off number of how many values ...

(Malaka Jayawardene) #1

Is there a cut off number of how many values can be added to an Enum type column? If I have, let’s say, more than 150 different types of surgeries to be included in an Enum type column where the user can simply search for one and then select it and proceed to fill the rest of the form, is it possible to add that many number of values to the Enum type column? I have currently added 124 different types of surgeries, but I feel I have more than 150, probably close to 200 by the time I finish this App I’m making. Any idea whether AppSheet would allow that many entries?

The second question is, when we type an expression for the AppFormula or ValidIf section, is there a maximum number of words that can be accommodated? Because I’ve seen that when I keep including a lot of expressions in to the same AppFormula (under a single working expression of course, ie: IFS([column name],CONCATENATE([Column name],“text”,[Column name],“etc.”),etc.) in which I can keep on writing expressions as long as I want), at some point after about 50 lines of expressions, the codes stop working. So is there a cut off limit for the length of the expression too?

Thank you.

(Philip Garrett) #2


@praveen is the expert on expressions. He may be able to help you.

(Praveen Seshadri (AppSheet)) #3

Hi @Malaka_Jayawardene yes there is a limit on expression length. Have you considered using SWITCH() instead of a lot of IFS ? If it is applicable, it can be a lot more compact.

(Malaka Jayawardene) #4

@praveen the reason for the lengthy expressions is because of the IFS expression that I had to use, so yes, it’d be great if it can be reduced in length. In the app that I’m trying to make, there is an Enum column called [Surgery], which has over >150 values of surgical titles. If the user selects one, then a new Enum column appears with related values to the surgical title. For example, if surgery title is Splenectomy, the [Further specify] enum column appears with ‘Emergency’, ‘Elective’ options. So, like wise for most of the surgical titles, the [Further specify] enum column opens up with related options, so I had to write a ValidIf expression using the IFS - IFS([Surgery]=“Splenectomy”,{Elective,Emergency},[Surgery]=“Skin Graft”,{Full thickness,Split thickness},etc, etc,…), and the expression keeps on growing, as I keep on adding surgical titles, so I was wondering whether it’ll stop working at some point. It’d be great if you could shed some light as to how SWITCH() can be helpful there. Thank you very much!

(Praveen Seshadri (AppSheet)) #5

Hi Malaka, what you need is a dependent dropdown. This will make your life much easier.

(Malaka Jayawardene) #6

@praveen Lovely! I will make a new table with 150+ surgery names and related sub options and then couple those column names with a ValidIf expression. Seems it’s way easier to manage if newer additions are required. Thank you very much for your guidance!

(Philip Garrett) #7


In answer to your first question.

When I have a lot of enum values I prefer to store them in a table.

  1. Create a worksheet with a single column it it. 2. Add a column header in row 1 like “Surgeries”. 3. Enter you valid enum values in that column with one enum value per row. 4. Add the worksheet to you app as a table. Calling it something like “SurgeryEnumValues”. 5. In your enum column enter the ValidIF expression


For more information see topic “A List of Values from a Column in Another Table” in this article - Dropdown from Valid_If

Dropdown from Valid_If

(Malaka Jayawardene) #8

@Philip_Garrett_Appsh Thank you very much. Any idea about the second question I asked? Would greatly value your input.

(Steven Coile) #9

@Malaka_Jayawardene I don’t know the answer to your second question, but you should carefully consider your approach. An expression that long is going to be very difficult to maintain over time or if someone else has to maintain it.