I want to iterate a a!save() expression for 10 (n times) when I press a button
Discussion posts and replies are publicly visible
a!localVariables( local!X, { a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Button", style: "OUTLINE", saveInto: a!forEach( items: enumerate(10)+1, expression: a!save( local!X[fv!index],fv!item ) ) ) }, align: "START", marginBelow: "NONE" ) })
What do you want to save using a!save() ? Can you provide us with more details
vijayp6380 You shouldn't be doing that unless you are sure that there is no better way to do what you are trying to achieve.
For example, the above code doesn't need a forEach loop if you just want to update the items of an array. It can be simplified as
a!save( local!X, enumerate(10)+1 )
But if you have a particular requirement which cannot be solved without a loop, then you have the code from Venky.