ValidateUpdateListItem and Looping
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Developer environment
None
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [ ] 💥 Microsoft Edge
- [x] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
- Power Automate
Describe the bug / error
Power Automate Flow that triggers on modified of SharePoint list item, updates same item with use of ValidateUpdateListItem endpoint. Since begin this week (that we noticed) it causing the flow to get triggered again.
It seems that this has been logged before in Oct 2021 #7424 and Nov 2021 #7527 Both with comments far into 2024. I tried to include the Author, Editor and Modified fields in the update. All together and one by one, but no change in the outcome.
I used this for multiple clients of different tenants. I now tested this on 2 different tenants and both solutions that use this endpoint in flows, are flows that keep being triggered.
Does anyone notices this problem on their tenants? Is something missing from my code, that wasn't needed till last week or so?
Steps to reproduce
- Create SharePoint List: Clients
- Create Power Automate flow > Automated cloud flow > When an item or a file is modified
- Add action Compose
Inputs:
[ { "FieldName": "Title", "FieldValue": "Test 123" }, { "FieldName": "Modified", "FieldValue": "@{addMinutes(triggerOutputs()?['body/Modified'], 120, 'yyyy-MM-dd HH:mm:ss')}" }, { "FieldName": "Author", "FieldValue": "[{'Key':'@{triggerOutputs()?['body/Editor/Claims']}'}]" }, { "FieldName": "Editor", "FieldValue": "[{'Key':'@{triggerOutputs()?['body/Editor/Claims']}'}]" } ]
- Add action 'Send an HTTP request to SharePoint' Site address Method: Post Uri: /_api/web/lists/getbytitle('Clients')/items(@{triggerOutputs()?['body/ID']})/validateUpdateListItem() Headers: None, also tried: { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose" } Body: { "formValues": @{outputs('Compose')}, "bNewDocumentUpdate":true }
Expected behavior
Flow not triggered after HTTP request is send to update the list item.
Hello @DAGiessenburg, Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.
@DAGiessenburg, We were able to reproduce the issue where the Power Automate flow is retriggered after using the validateUpdateListItem() endpoint. We have logged this as a bug, and our engineering team is currently investigating the behavior.
As part of our testing, we noticed that when only the Title field is changed, the flow behaves as expected and does not retrigger unexpectedly. I’ll be confirming this behavior in more detail and will also consult with the engineering team to understand why the retriggering occurs despite preserving system fields like Modified, Editor, and Author.
We appreciate your input and will keep you updated as we learn more.
@Ashlesha-MSFT thank you for the information and confirmation. I want to elaborate on that i didnt needed to add the system fields like, Title, Modified, Editor, and Author before. It was working with only my custom fields that I needed to update, in the request for till week before last week.
@Ashlesha-MSFT any status update about this issue?
Hi @Ashlesha-MSFT,
I am also experiencing the exact same issue @DAGiessenburg described.
@DAGiessenburg, Thank you for your patience. There are no updates to share just yet. We understand the impact. We’ll get back to you as soon as we have more information to share.
@Ashlesha-MSFT any status update about this issue?
Hello @Ashlesha-MSFT , since @DAGiessenburg is out of office, I am curious what the status of this bug is. This is causing a major issue of our solution at the customer.
Hi @Ashlesha-MSFT any update, we already needed to postpone the rollout of a solution at the client, the solution heavily depends on this endpoint in the API to work. Do you maybe have a workaround?
I would also appreciate an update, I have a solution dependent on this going live next week. Thanks.
@Ashlesha-MSFT Looking at all the different issues on this repository, I think you all have a lot to look at. Is there anything I can help out to make this issue more clear, test some things or other. Is there another place that I can file a (service) issue?
I just re-tested in my environment and I can confirm this issue is still there.
Dear @Ashlesha-MSFT,
Any update on this topic?
Thank you for your support on this topic.
@aaclage, There are no updates to share just yet. We’ll get back to you as soon as we have more information to share.
Hi Daniel, I'm just implementing the same for one of my clients and it still works however, to avoid locking issues I had to include a parameter
"sharedLockId": "@{body('Send_an_HTTP_request_to_SharePoint_-_Get_Lock')?['d/vti_x005f_sourcecontrollockid']}"
Where the referenced action in the above expression runs a GET on the following endpoint: _api/web/Lists/GetbyTitle('My Document Library')/items(@{triggerBody()?['number']})/File/Properties
I have noticed however that the process that is locking the process initially seems to blank out the updates that I'm trying to make. If I do the same update 10 minutes later again then the update is successful.
After contact with Microsoft support the conclusion is as follows: bNewDocumentUpdate is there to prevent an extra entry in the version history. It does NOT prevent activation of the power automate trigger when bNewDocumentUpdate is set to true. So you need to manually check this in the trigger condition to prevent the flow from looping.
Hi everyone, are you still facing this issue? I think I am. No news about it yet?
It appears that Author/Created By field is simply no longer updatable (at least on the word document) - tried multiple approaches:
- setting ReadOnly property on Author field to false and then updating (PowerAutomate) ,
- ProcessQuery API (PowerAutomate) ,
- regular SP API PATCH to the item endpoint (using both PnPjs in SPEditor and PowerAutomate),
- ValidateUpdateListItem (PowerAutomate) api,
- and QuickEdit mode in both Modern and Classic UI. Also attempted @Pieter-Veenstra trick, but not getting vti_x005f_sourcecontrollockid from /File/Properties.
Endpoints return success, but value comes back unchanged.
Scenario I am looking at is to change Created By as original document creator keeps getting e-mails every time there are comments/edits/tracked change in the document (even when is not explicitly @mentioned) and he is no longer involved on the project.
Hi @Brooxelas , my last comment is the update that this is not a bug, but as designed. This flag is not designed to prevent power automate to fire.