I have three App Variables of Object type called “player1”, “player2”, and “player3”. I also have a Page Variable called “playerIndex” which is a Number.
Using the Set App Variable flow function, I am given the choice to select an App Variable or the Output From Previous Node.
The App Variable choices are set, with a drop down giving me “player1”, “player2” and “player3” as options. What I would like to do is choose the App Variable based on the value of another variable (in this example, the “playerIndex” variable), so it would read like:
App Variable: “player”+playerIndex
(where it would select player2 if the playerIndex variable is “2” etc)
Given the App Variable option in Set App Variable flow function is hard coded, I assume I must use the Output From Previous Node option instead.
My question is: what is the best way to do this? Do I need a JS module prior to this Set App Variable that returns the dynamically-generated name? If so, what format should it be in? Text?