I want to create a loop where the variable name is dynamic.
So, in this case I want the variable "test" to increase with the count. So, the variable is called "test0", "test1", "test2" as the loop goes, so it does not overwrite the existing variable.
But I constantly gets a syntax error when I try to use different inputs. Is there a way to do this?
Kind regards
Have you tried creating a list using the action Create new list? Then use the action Add item to list to store the data into the list.
To retrieve the items stored in the list, use the notation %VariableName[ItemNumber]%. In the example above, it will be %List[0]%, %List[1]% and %List[3]% for the first 3 items in the list respectively. Note that the ItemNumber or index starts from 0. Going back to your question, %List[0]%, %List[1]% and %List[3]% will be the closest thing you can get to dynamic variables. Hope this helps.
To learn more, visit https://werkbook.co/
I want to build general subflows I can use across different solutions. I am aware that I can create data tables and store the values there, but in some cases that is problematic.
Example:
Here I must attach to multiple Excel-instances and I want them to be saved under different variables so I can call them later on. But the loop in this case overwrites the previous instance and I can’t save the instance in a datable as is it not understood as an excel-instance and the call therefore will fail.
But as i understand it there is no simple workaround this.
This is not possible to declare variables dynamically.
You could use data table and store key value pairs for example:
PseudoVariablename : Value
var1 : value1
var2 : value 2
var3 : value 3
What do you want to achieve with this approach?
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2