Re: Clear array variable in a flow
Hi @Kamil,
Could you please share a screenshot of your flow's configuration?
Do you want to set the array variable to empty for next iteration of loop?
I think a empty array variable could achieve your needs, I have made a test on my side and please take a try with the following workaround:
- Add a proper trigger, here I use Flow Button trigger.
- Add a Variables-> "Initialize variable" action, Name set to GlobeArray, Typre set to Array and Value set to empty.
- Add a "Get items" action, specify Site Address and List Name.
- Add a "Apply to each" aciton, input parameter set to output of the "Get items" action. Within "Apply to each", add a "Append to array variable" action, Name choose GlobeArray, Value set to Due Time dynamic content of the "Get items" action.
- Under "Apply to each" action, add a "Compose" action, Inputs set to GlobeArray variable.
- Add a Variables-> "Initialize variable 2" action, Name set to EmptyArray, Type set to Array and Value set to empty.
- Add a "Set variable" action, Name choose GlobeArray variable, Value set to EmptyArray variable.
Image reference:

The flow works successfully as below:
The value of GlobeArray variable after first iteration of loop as below:
The value of GlobeArray variable after clearing array as below:
Best regards,
Kris