cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Flow triggers again when set content approval updates the status

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

condition

send an email

set content approval status

11 REPLIES 11
Highlighted
Dual Super User III
Dual Super User III

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.

http://johnliu.net/blog/2019/2/flowninja-hack-78-modifying-modified-by-and-modified-time-with-micros...



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted

@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 gandalf@johnliu365.onmicrosoft.com will be ignore. Am I correct? If yes, then the I'm using request.submitted@company.com as a connection between SharePoint and flow. if I replace gandalf@johnliu365.onmicrosoft.com with request.submitted@company.com 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.

Highlighted
Super User III
Super User III

@rubertjack 

Can you post a screen shot of your Flow. I just did some quick testing and have been unable to replicate your issue.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Highlighted
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted

@ScottShearer Thank you for trying to recreate. Below are the screenshots. I'm having same issue with other flows which are identical. 

 

Untitled.pngUntitled 1.png

Highlighted

@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. 

Highlighted
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted

@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. 

 

Capture.PNG

 

@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? 

 

Capture1.PNG

Highlighted
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted

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!

 

Best Regards,

Alice

 

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.

Highlighted

@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. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (7,348)