I am using nested IF formulas but I suspect there may be a better way. When I drop these formulas in (after creating them in Excel), it takes a few seconds for Composer to digest them, but more importantly, since I have been using them, when testing in Runtime 2.5.12, the app is taking more time to load. So it makes me think my solution is cumbersome even though the dropdowns work perfectly fine in the app. Is there a more efficient way to do what I want?
It is a fitness app. So I have two dropdowns on the same page, lets say, one is for βLevelβ and one is for βStageβ. Stage is dependent on Level. For example, Level 1 has 22 Stages, Level 2 has 30.
Note in these dropdowns, label and value are always the same. I am linking the output of Level to a page variable.
For βLevelβ, I have 1 to 10, so I can just use the dropdown functionality and populate as below;
For βStageβ, I am using nested IF formulas that look like this;
IF(NUMBER(pageVars.Level) == 1,[{label:β1β, value:β1β},{label:β2β, value:β2β}, {label:β3β, value:β3β}, {label:β4β, value:β4β}, {label:β5β, value:β5β}, β¦β¦.,{label:β21β, value:β21β},{label:β22β, value:β22β}],
IF(NUMBER(pageVars.Level) == 2,[{label:β3β, value:β3β}, {label:β4β, value:β4β}, {label:β5β, value:β5β}, {label:β6β, value:β6β},{label:β7β, value:β7β},β¦β¦.,{label:β29β, value:β29β}, {label:β30β, value:β30β},
IF(NUMBER(pageVars.Level) ==3 β¦β¦β¦β¦β¦
These formulas become quite long, but they work. Is there a more efficient way to do this, and is the size of these formulas making the app take longer to load?
I thought perhaps I could use a database to store the array, and reference that, but I donβt know where to start in terms of getting a database to store an array (I am using Backendlessβ¦)
Thanks
Paul