Power Automate Flow: Concurrency, recurrence, and condition control issues (2 Viewers)

Isaac

Lifelong Learner
Local time
Today, 02:31
Joined
Mar 14, 2017
Messages
8,738
Posting this informational thread to help anyone else who may come across these similar issues.

I had a Power Automate flow that was supposed to loop through a Sharepoint list and make some determinations. If certain conditions all evaluated to True, then it would update the record with DateEmailSent (expression=utcNow() ) and then at the very end, AFTER the loop was finished, if the variable varEmailAddresses was not equal to placeholder@domain.com (which is what I set its initial value to in the Initialize Variable operation), then it should send an email using Replace() on the BCC field: Replace(variables('varEmailAddresses'),'placeholder@domain.com;','')

During the loop, depending on a condition, I would concatenate the varEmailAddresses variable (using an Append Variable operation). I would add a semicolon plus an email address from a Sharepoint column to varEmailAddresses. Thus, at the end, either none of that would have happened (making varEmailAddress simply placeholder@domain.com), or else varEmailAddress would include more 'real' email addresses, like: placeholder@domain.com;realperson@mycompany.com;realperson@mycompany.com, etc. Thus the Replace function.

I ran into a few problems and learned something.

1. If you are using a Condition control and comparing something to literal text (using equals or not equals, etc), you don't put quotes - either single nor double - around the literal text, like you would in an Expression (e.g. Replace). You just type the literal text.

1618089739136.png


2. If your Flow does things like retrieve records, read them, make determinations and possibly update them or take action depending on those determinations, you need to think of the Concurrency question. I found out that by default, my Flow was allowing a high number of concurrent (parallel) runs. Given that I set it to run every minute or two, this was causing total chaos! Solution: In the first operation of my Flow, the Recurrence operation, I clicked the ellipsis button near the upper right hand corner of the box and went to Settings. I then turned Limit to On, and lowered the # of concurrent runs allowed to 1. This solved a lot of problems that were starting to really confuse me. In hindsight this seems obvious, but I hadn't realized that this particular type of operation (Recurrence), has a button called Settings (in the ellipsis button) that most operations don't have, hence, I'd never noticed before that I was expected to manage this particular configuration aspect - and has assumed there were no parallel runs happening at all until I found this out.

Hope this helps someone someday!
 
Last edited:

NauticalGent

Ignore List Poster Boy
Local time
Today, 05:31
Joined
Apr 27, 2015
Messages
6,286
Isaac, how did you do the Solved/Solution thingy? Did we get a new plug-in?
 

Isaac

Lifelong Learner
Local time
Today, 02:31
Joined
Mar 14, 2017
Messages
8,738
Isaac, how did you do the Solved/Solution thingy? Did we get a new plug-in?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:31
Joined
May 7, 2009
Messages
19,175
hmm, never use this.
i am using VisualCron for repeating (routinely) tasks.
 

Jbooker

New member
Local time
Today, 05:31
Joined
May 12, 2021
Messages
25
Concurrent run count is a nice setting to know. You can quickly run out of runs in your license with the recurring trigger. Another good one - especially if you must use recurring trigger - also hidden in trigger settings are trigger conditions. There you can use expressions similar to the condition task to restrict execution.
 

Steveskok

New member
Local time
Today, 15:01
Joined
May 20, 2021
Messages
4
1- Export your flow to a zip package. (from flow details page, click export on top bar)

2- Open the package. Inside that package, find the file "definition.json" and open it with a json editor

3- Remove the recurrence node. It is under object > properties > definition > triggers > (type of trigger you have > runtimeConfiguration

4- save and import back into Power Automate as a new workflow.
 

Users who are viewing this thread

Top Bottom