I have a simple use case that's turning out to be much more complicated to "code" than I signed up for. Essentially, I'm creating a Purchase Order Request solution using a SharePoint list with versioning and content approval enabled.
The approval process kicks off using the "When an item is created or modified" SharePoint Connector trigger and makes use of the Approvals Connector to update the Content Approval Status according to the administrator's response to the Approvals Connector message. Once the admin selects Approve or Reject from the message, the flow then updates the item's Content Approval Status according to the response using Conditional Cases for Approve and Reject.
This all works fine and the Content Approval Status changes in the list item with the approver's comments, but because a "new" modification to the SharePoint item ensues by updating the Content Approval Status field, the original flow invokes a second flow, and hence another Approvals request for an item that's already been triaged and actioned on.
In order to get around this, I added a Condition at the beginning of the flow that checks whether or not the Content Approval Status field is already in an Approved or Rejected state and immediately terminates the recursive flow if it is. This seems to work, but also convolutes the logs with two flows per trigger. And when I add email notifications to the mix, multiple emails end up firing as a result.
Is there some built in mechanism that can be leveraged to avoid this duplicate flow behavior? I really wish there was a trigger for when an item is created and another for when an item is modified.