Skip to content

validateUpdateListItem causing PowerAutomate flow to trigger  #7424

@adam13hylo

Description

@adam13hylo

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • PowerAutomate with per user plan.
  • Web region set to (UTC) Dublin, Edinburgh, Lisbon, London
  • Web Locale set to English

Describe the bug / error

Currently I have a very simple PowerAutomate flow that is triggered on item creation or modification. The flow is associated with a very basic list containing just a title column for testing purposes. Using the 'validateUpdateListItem' endpoint along with the SharePoint HTTP action I am trying to update the title.

When testing this the list item is updated as expected, and the version does not increment, however the PowerAutomate flow is triggered again as if the list item has been modified.

When inspecting the body of the trigger when the flow is triggered I can see that the modified date is an hour behind that of the actual modification time, as an example:
ModifiedDate

Even when converting the date to UTC using a PowerAutomate expression in the body of the HTTP Post action I am finding that the flow is being triggered multiple times, as an example:

image

Currently the HTTP Post Action is configured as so:

Endpoint
https://tenant.sharepoint.com/sites/sitecol/_api/web/GetList('/sites/sitecol/Lists/mylist')/items(22)/ValidateUpdateListItem()

Method
Post

Headers

{ "Accept": "application/json;odata=nometadata", "Content-Type": "application/json;odata=nometadata" }

Body

{"formValues":
	[
{ "FieldName": "Modified", "FieldValue": "2021-10-21 22:52:36" },
{"FieldName":"Editor", "FieldValue":"[{'Key':'username@tenant.onmicrosoft.com'}]"},
{"FieldName":"Title","FieldValue":"UpdatedTitle"}
	],
		"bNewDocumentUpdate":true
}

Steps to reproduce

  1. Create Automated Cloud Flow
  2. Select 'When an item is created or modified' trigger
  3. Set trigger to be associated with SharePoint list.
  4. Add 'Send an HTTP request to SharePoint' action to flow.
  5. Set the method on the action to 'Post'
  6. set the URI to:

/_api/web/GetList('/sites/validateupdatelistitem/Lists/ValidateUpdate')/items(@{triggerOutputs()?['body/ID']})/ValidateUpdateListItem()

  1. Set the headers to the following:

{ "Accept": "application/json;odata=nometadata", "Content-Type": "application/json;odata=nometadata" }

  1. In the body set the form values, these have been set as follows:

{"formValues": [ { "FieldName": "Modified", "FieldValue": "@{convertFromUtc(triggerBody()?['Modified'], 'GMT Standard Time', 'yyyy-MM-dd HH:mm:ss')}" }, {"FieldName":"Editor", "FieldValue":"[{'Key':'@{triggerOutputs()?['body/Editor/Email']}'}]"}, {"FieldName":"Title","FieldValue":"UpdatedTitle"} ], "bNewDocumentUpdate":true }

  1. Create new list item in the list associated with the flow, the flow should trigger multiple times.

Expected behavior

I would expect the list item title to be updated but that the flow would then not run again, this is a tried and practiced method I have used before and it has only recently started happening so I am not sure if this is a bug with PowerAutomate or a change with how the 'validateUpdateListItem' endpoint works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APItype:archive-old-issueIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions