sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

ValidateUpdateListItem and Looping

Open DAGiessenburg opened this issue 4 months ago • 18 comments

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

  1. Create SharePoint List: Clients
  2. Create Power Automate flow > Automated cloud flow > When an item or a file is modified
  3. 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']}'}]" } ]

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

DAGiessenburg avatar Aug 22 '25 10:08 DAGiessenburg

Hello @DAGiessenburg, Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.

Ashlesha-MSFT avatar Aug 22 '25 10:08 Ashlesha-MSFT

@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 avatar Aug 25 '25 05:08 Ashlesha-MSFT

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

DAGiessenburg avatar Aug 25 '25 08:08 DAGiessenburg

@Ashlesha-MSFT any status update about this issue?

DAGiessenburg avatar Sep 01 '25 13:09 DAGiessenburg

Hi @Ashlesha-MSFT,

I am also experiencing the exact same issue @DAGiessenburg described.

idris-m121 avatar Sep 03 '25 06:09 idris-m121

@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 avatar Sep 03 '25 07:09 Ashlesha-MSFT

@Ashlesha-MSFT any status update about this issue?

officekeys-nl avatar Sep 11 '25 07:09 officekeys-nl

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.

Buro-GEKKO avatar Sep 12 '25 06:09 Buro-GEKKO

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?

DAGiessenburg avatar Sep 16 '25 14:09 DAGiessenburg

I would also appreciate an update, I have a solution dependent on this going live next week. Thanks.

idris-m121 avatar Sep 17 '25 02:09 idris-m121

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

DAGiessenburg avatar Sep 18 '25 08:09 DAGiessenburg

Dear @Ashlesha-MSFT,

Any update on this topic?

Thank you for your support on this topic.

aaclage avatar Sep 29 '25 09:09 aaclage

@aaclage, There are no updates to share just yet. We’ll get back to you as soon as we have more information to share.

Ashlesha-MSFT avatar Sep 29 '25 09:09 Ashlesha-MSFT

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.

Pieter-Veenstra avatar Oct 03 '25 11:10 Pieter-Veenstra

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.

Buro-GEKKO avatar Oct 24 '25 07:10 Buro-GEKKO

Hi everyone, are you still facing this issue? I think I am. No news about it yet?

Brooxelas avatar Nov 14 '25 16:11 Brooxelas

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.

alexabramkin avatar Nov 22 '25 19:11 alexabramkin

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.

Buro-GEKKO avatar Nov 24 '25 08:11 Buro-GEKKO