Hi there,
I have a flow i'm working on based on the template When a file is added, approve file using Sharepoint content approval. However i've modified the trigger to be When a file is created or modified (properties only).
All works well however 5 minutes after running the approval, there is a second approval email sent out which duplicates the first one.
If this approval is done a second time, no problems occur and all works fine but it's a nuisance.
Any ideas why this might be?
Thanks.
Chris
Solved! Go to Solution.
Finally found a good solution, takes time to implement but thanks to the person responsible!
https://powerusers.microsoft.com/t5/General-Flow-Discussion/Reading-Approval-Status/m-p/199210
Does this template modify the file properties in your library?
If so, then flow is executed twice, first when fil is added, then when file is modified. You can potentially enter a neverending loop
Hope this helps
Proud to be a Flownaut!
Thanks for the comment. I can confirm there is no endless loop, it only happens twice.
The final action taken on the item is "Set content approval status to approve" which happens as a result of the approval flow, nothing else.
All works correctly apart from the double emails, strange.
I have been looking at the template, and I guess you are using the same Library NAme for both the trigger and the following actions: "Set content pproval status to approve" and "Set content approval status to reject" right?
If so, when approval/rejection is received, your Flow is modifyig file properties on the Sharepoint library, and flow is triggered again. If you approve/reject the second approval, Flow will trigger again.
I guess when someone adds a new file to the library, its "Action" property will be set to "Submit" by default, right? If so I suggest you to add a condition just after the trigger to evaluate "Action". If value is "Submit", terminate the flow, if not, continue processing.
The new condition to evaluate should be:
Proud to be a Flownaut!
Thanks for that. I tried the suggestion however "Action" does not appear within any of the available variables from the other objects. After manually typing it in and running the flow, the expression always evaluates to false every time.
"Action" seems to be a column that should be available in your Sharepoint Library, it helps you to store the status value of each File Approval. It seems to be of type "Choice" with three different values.
Hope this helps
Proud to be a Flownaut!
Finally found a good solution, takes time to implement but thanks to the person responsible!
https://powerusers.microsoft.com/t5/General-Flow-Discussion/Reading-Approval-Status/m-p/199210
Can you explain more, how to implement this solution into trigger "When a file is created or modified (properties only)" ?
Where it should put?
Thanks
I believe it should work, just change your "Output" variable in the code the reference the "ID" of the new trigger for the file object.
@angger_aa wrote:Can you explain more, how to implement this solution into trigger "When a file is created or modified (properties only)" ?
Where it should put?
Thanks
Update:
I've made the flow to be like this
But the result condition which get the "Approval Status" is always False.
Am I wrong or missed something?
Thanks
=========================================================
Sorry, I do not understand yet for this issue.
FYI, I've been created the flow like this
Do I have to create a new flow for the solution "just change your "Output" variable in the code the reference the "ID" of the new trigger for the file object." ?
Or how to implement the solution?
Thanks
@chrismanncg wrote:I believe it should work, just change your "Output" variable in the code the reference the "ID" of the new trigger for the file object.
@angger_aa wrote:Can you explain more, how to implement this solution into trigger "When a file is created or modified (properties only)" ?
Where it should put?
Thanks
Hope the screenshot helps. I've not got time to go any more into this sorry, very busy.
User | Count |
---|---|
76 | |
58 | |
48 | |
29 | |
20 |
User | Count |
---|---|
28 | |
27 | |
26 | |
21 | |
20 |