0

I am pretty new to power automate. I created a flow that triggers when an item is created or modified. It initializes some variables and then does some switch cases to assign values to each of them. The variables then go into an array and another variable is incremented to get the total of the array. I then have a conditional to assign a value to a column in the list. I tested the flow specifically going into the modern view of the list and clicking the save button. This worked a bunch of times and I sent it for user testing. One of the users edited multiple items by double clicking into the item which saves after each column change(which I assume triggers a run of the flow)

The flow seemingly works but seemed to get bogged down at a point based on run history. I let it sit overnight and then tested again and now it shows runs from multiple IDs at a time even though I only edited one specific one.

I had another developer take a look at my flow and he could not spot anything wrong with it and it never had a hard error in testing only warnings about conditionals causing a loop but all my conditionals rectify. Pictures included. I am just not sure of any caveats I might be missing.

I am currently letting the flow sit to see if it finishes getting caught up. I read about the concurrent run option as well as conditions on the trigger itself. I am curious as to why it seems to run on two records(or more) all at once without me or anyone editing each one.

Run History. Flow ran all night stopped for a couple hours then ran more up to that point without my interaction on the items. Not sure if previous runs were done and it just caught upConditional ControlArray set up and apply to each to increment totalSwitch Cases that set variables

Variables that are all integers

4
  • 1
    I see three instances of the Update Item action in your screenshots. Are you updating the list item of the trigger in those actions? If so, it could be that in some instances you are retriggering the flow with the update again. I would definitely look into using trigger conditions. That is a good way to stop the flow from triggering unnecessarily. Let me know if you need any help with writing such a trigger condition expression. Commented Sep 9, 2022 at 10:44
  • @Expiscornovus Yes! Essentially the list this flow is attached to is filled out by a site auditor and after they are done with their audit they save the item and it takes their scores and totals them up and then updates the list item column to a specific choice based on the variable that gets totaled up from the array. Testing the flow I was triggering the flow with my account which is also the account that created the flow. I moved it to an account we have setup just for flows but it still loops on that account as well even if triggered by a different account. Help would be great!
    – OMGDrAcula
    Commented Sep 9, 2022 at 13:46
  • @Expiscornovus I also updated the flow to only have one update item versus three. The conditional now just sets a variable and the update item updates the column based on the variable value. But it still runs over and over.
    – OMGDrAcula
    Commented Sep 9, 2022 at 13:51
  • 1
    One trigger condition expression which comes to mind is that you ignore the items if they have been last modified by that account used in the flow. This way it will only be triggered by end users. Commented Sep 9, 2022 at 14:13

1 Answer 1

2

You might be able to ignore the updates from the service account/account which is used in the connection of the actions by using the following trigger condition expression:

@not(equals(triggerOutputs()?['body/Editor/Claims'], 'i:0#.f|membership|[email protected]'))

enter image description here

4
  • Cool I will give this a try for sure. Is it strictly the update item piece being tied to the same ID that triggered the flow causing the loop? I feel like that is something that shouldn't happen. Or is an oversight from Microsoft. I feel flows running and users updating an item being a common thing.
    – OMGDrAcula
    Commented Sep 9, 2022 at 14:53
  • I just find it overall odd that even moving my flow to a different account and then using my personal account to trigger the flow still causes the loop. Unless like you said it is strictly because the same ID triggering the flow is the one being updated. I am new to automate so sorry for all the questions.
    – OMGDrAcula
    Commented Sep 9, 2022 at 15:00
  • So I added a trigger condition checking the email of the modified by and it so far knock on wood seems to be working. Thanks for the help! No idea why it still looped even with using different accounts. I guess update item just loops unless a trigger condition is set when using created or modified.
    – OMGDrAcula
    Commented Sep 9, 2022 at 17:44
  • 1
    Great to hear it works. The modified trigger action is a webhook which basically looks at any modification of list items, does not matter if it is modified by an account used within your flow. That's why if you don't want that you need to add addition configuration to prevent that from happening (like a trigger condition). Commented Sep 10, 2022 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.