Hi I have an issue when clearing an array.
I append data to an array but it needs to be cleared every loop. To do this I made an empty array variable and set it as the value of the array. Problem is when I use this, my flow runs forever and never stops. Removing this means the flow completes but then data keeps being appended to the array which I don't want to happen.
Any other ways I can clear the array?
Just to double check. Which action did you use to empty the array. Was this the Set variable action and did you use  as the value to make it empty?
If so, can you share a couple of screenshots of the rest of your flow?
Thanks for replying,
I have tried using the set variable to set the arrays value to .
I also made an array variable that was initialized with no value and , all cause the flow to never end.
I was clearing the array straight after I use it.
The point of the flow is to add an attachment to a sent email, I tried doing this with SharePoint's get file content from path but I had to hard code it with the array as sometimes get file content wouldn't get the files (so the array value is very long). The array needs to emptied or else they receive multiple email attachments.
I have just tried again and it has stopped working.
Trying to set or clear the array results in the flow continuously running, but appending to the array works fine.
Unless the length of the string I am passing into the array is the issue otherwise I am not sure.
Strange issue. Can you share a screenshot of the whole setup of your flow?
Let me rebuild it in my development environment and see if I can reproduce your behaviour. After that I can try and find a solution for it.
Thanks for your help.
I managed to solve it by using the file get content from path dynamic content as the value for $content inside the array. It let me set the array without issue after that.
Check out the News & Announcements to learn more.
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.