Hi,
I'm looking at the results of a flow that has run. It is showing me different results for the same variable that was not changed.
I'm comparing two arrays. First array is a list of all my users. Second array is the temperature records submitted into SharePoint. I loop through every user in my first list and use filter array to see if they are in the second array. If length of filtered array < 2 (only 1 or 0 records for the day), then send an email alert. I use strCheckEmail to store each user as I loop through the first array. The same variable is used for Send Mail.
You can see from the screenshots that although strCheckEmail=hoongkaixuan, it mysteriously becomes adriantan when the filter array and Send Mail action occurs.
Any idea?
Below is my flow configuration.
My flow settings.
Comparing against each array item
strCheckEmail=hoongkaixuan. However filter array output shows adriantan
Here it changes to adriantan.
Solved! Go to Solution.
Hello @rucysg
What is your concurrency set to on the loop?
Check this by clicking the 3 dots on your apply to each loop > Settings.
Concurrency should be set to 1 or off when using a Set variable action inside a loop.
What you can try is to change the Set variable to a Compose action. And see if the results are the same.
Proud to be a Flownaut!
Hello @rucysg
What is your concurrency set to on the loop?
Check this by clicking the 3 dots on your apply to each loop > Settings.
Concurrency should be set to 1 or off when using a Set variable action inside a loop.
What you can try is to change the Set variable to a Compose action. And see if the results are the same.
Proud to be a Flownaut!
Thanks @Jcook. The concurrency setting was on. I've turned it off and will see what happens when the flow runs.
Would I still need to use Compose instead of Set?
You only need to use Compose if you have Concurrency set higher than 1.
To give some context,
When using a Compose, you can use any concurrency setting, the downfall is anything inside the compose cannot be referenced outside the loop.
A Set variable can be referenced outside a loop, but concurrency cannot be on, or set to higher than 1.
Proud to be a Flownaut!
User | Count |
---|---|
6 | |
5 | |
5 | |
3 | |
2 |
User | Count |
---|---|
11 | |
9 | |
7 | |
7 | |
4 |