A laymans solution to infinate loop problem with ''When an Item is Created or Modified''
Hi all, I'm writing this comment after succesfully stopped a loop in ''When an item is created of modified''. As I'm a newbie to Flow this took a lot of time to get the logic correct. I hope that this comment might help others, so let's go.
TLDR; Write Trigger Conditions for the ''When an item is created or modified'' and add these blockers with ''Update Item''. You can create hidden colums for the list if you need more blocker data.
Background: When a new item is added to a list or an existing item is modified, an email needs to be sent and the item gets new meta data. Ok, doens't sound that difficult? Well..
Paradox: The new meta data will trigger the flow once again, causing a loop, this we know.
Case triggers: for this particular flow the triggers are: ''Delivery date < today & Send = true & OrderID = false'' we identified that the trigger ''delivery date < today'' where the cause of the loop, the other two triggers we could block with new meta data on the item.
Solution: in the settings for ''When an item is created of modified'' you have options to set Trigger Conditions, after some testing we could determinate that each row of Trigger Conditions where ''AND'', not ''OR''. Therefore the ''OR'' needed to be in the same row, here's our 1st condition:
Ok, we've now blocked 2/3 of the triggers, the date < today still causes a loop. This got solved by utilizing the ''AND'' relationships between the rows of the Trigger Conditions. This is the condition:
Though our list didn't have a metadata showing if an email has been sent or not, so we created a hidden column called ''Sent = YES/NO'' with ''NO'' being the standard value. With this we can update our metadata to YES and therefore blocking all triggers when the item is modified.
The end result of the trigger conditions looks like this.