I'm using the below list of trigger/actions for my flow and it works as expected. When the content is approved or rejected, the flow is triggered again because the content gets updated by "set content approval status" action. How do I stop the trigger again if the approval status changes to avoid duplicate approval process.
When an item is created or modified
Get file metadata
send email with options
send an email
set content approval status
The only way to do that at the moment is to make the content update using an HTTP request. Take a look at this post and pay specific attention to the use of bNewDocumentUpdate: false. That's what tells SharePoint not to consider this a modification so the trigger won't fire.
@Pstork1 Thank you for your response.
I'm a beginner in Flow and with codes, I'm zero.
From the link what I understand is if "bNewDocumentUpdate:true" then changes made by email@example.com will be ignore. Am I correct? If yes, then the I'm using firstname.lastname@example.org as a connection between SharePoint and flow. if I replace email@example.com with firstname.lastname@example.org and change false to true for bNewDocumentUpdate:, my problem will be solved?
Also, When a user edit the content which he/she submitted, the flow should trigger.
How do I get the options compose user and compose? I found Send an HTTP request to SharePoint in new step. Where should I place these 3 conditions in my flow?
EDIT: I found compose and I believe compose has been renamed to 'compose user'. Just wanted a clarification on the bold texts above.
Can you post a screen shot of your Flow. I just did some quick testing and have been unable to replicate your issue.
Setting bNewDocumentUpdate:true will prevent changes made in that HTTP call from triggering a new run of the flow. But it won't change triggering caused by other actions in the flow. So its not just a matter of adding that to the flow. YOu need to actually use that http call to do the updates you do now in the Update content approval.
@ScottShearer Thank you for trying to recreate. Below are the screenshots. I'm having same issue with other flows which are identical.
@Pstork1 Thank you for the update. How do I do that? Also, I was trying out the steps from the link you shared and the function: String () under compose section, I have no idea what details it needs to contain.
As the Blog post shows. For each field that you want to change you need to create an array element in the JSON that contains the FieldName and the value you want to set it to. The String function you see in the example is there because that particular field needs a more complex value that was built using a string function. What goes in each FieldValue is dependent on what type of field it is and what value you want to set it to. There's no way to be more specific than that without knowing exactly what you are trying to change.
@Pstork1 I've enabled content approval on SharePoint document library where the form is published. the "set content approval status" action is updating the field 'approval status' in SharePoint document library saying approved or rejected. Every time it gets updated, flow triggers again.
@ScottShearer I used SharePoint designer to create and manage the document library and I used below option to create the document library. Wondering, should I use 'form library' rather than document library and that would solve the issue?
As I said previously, using any action that updates the document or metadata, other than the HTTP call with bDocumentNew set to true will trigger another flow because the document is being updated. The only way to prevent that is using ONLY HTTP REST calls to do the updates.
Hi @rubertjack ,
Have your problem been solved? If yes, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-alzhan-msft No, its not solved. I think I've reached a dead end as I'm just a beginner on Flow, sharepoint and code and unable to implement Pstork1's suggestion.
We can close this as unsolved. I'll disable 'set approval content' action to avoid the duplication of email. Thanks all for your support.