Showing results for 
Search instead for 
Did you mean: 

Initialize Multiple Variables in the same Action

It would be really convenient to be able to initialize multiple variables inside of the same action.  Especially since the action must occur at the top level.  This would help clean things up, plus make it easier to locate where the variables are actually initialized.


So for example, I can say "Initialize Variable"

Then inside the action I add a String named "TestString"


Then maybe I have a little link for "add another variable"

So I add an Integer named "Counter"


Then I add an Array named "TestArray" and so on.

Status: New
Frequent Visitor

Either this or the option to create global variables via a settings button similar to Nintex.

Advocate I

Yes please! My design is very slow to load due to all the variables I am using, pleae allow to initialize the variables in 1 state. It makes it that much easier, or allow them to be created in a scope

Advocate I

I would also like to do this in a single action, but if someone is looking for a workaround... Instead of selecting "Add an Action" after clicking the plus sign, select "Add a parallel branch" then add "Initialize variable".

IMO There's hope that adding multiple variables in this single action is on it's way. If you click on the elipsis (...) on the "Initialize variable" action and select "Peek code" there is an array called "variables". I'd like to assume that there is intention to add multiple variables, but the funtion has yet to make it to the front-end of Flow's UX. This is totally a guess btw. Here's hoping!

Advocate II

Yes please!

I was trying to do something like setting the variables inside a do until loop. Something like do until count = 6 for 6 variables. But i cannot get the current iteration index. 


This would really help clean up the flow.

I put my vote into this feature.


Please make it happen flow team! Smiley Very Happy

Thank you very much.

Advocate V

Any mature workflow solution allows you to initialize multiple variables at the start of a flow in a single statement.  To have to init each variable separately is ridiculous!  Never mind finding workarounds, just release a 'Initialize multiple variables' action.




New Member

Yes, this is badly needed. Half of my workflow tends to be purple. It's kind of ridiculous.

New Member


(1) Put all your variables in one json format string


"ssc":"some value",
"ap":"some value",
"taskId":"some value",
"categoryBucketId":"some value",
"dueDate":"some value",
"startDate":"some value",
"endDate":"some value"


(2)  Use Parse JSON. Let it create the schema for you by passing a sample of your JSON string.


(3) Now you can use the parsed value anywhere in your code.



Frequent Visitor

@Robmeister , a great suggestion for using constants, but most of the time I'm using variables, it's because I'm changing that value throughout the flow, in [Apply to each...] loops most often.


Do you have any workarounds for that?



Not applicable

Using variables is a good practice as it makes a workflow portable and much easier to maintain. It would be a valuable feature to be able to define a set of variables in one action, or in a scope which would make a complex workflow neater. 




Any updates on this? I was thinking to use json and "Apply to each", but inside loop you're not allowed to initialize variables. I also tried appending keys to object, but this way parallel branches can't mutate the same object (only the slowest branch can add one key at the end). So I'm still using this massive horizontal scroll...