web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SharePoint Update Item...
Power Automate
Answered

SharePoint Update Item Bad Request - Would Create Duplicate

(0) ShareShare
ReportReport
Posted on by 46

What would cause an Update Item to fail as a BadRequest because of a duplicate value?

 

"status:" 400,

  "message": "The list item could not be added or updated because duplicate values were found in the following field(s) in the list:
 
It is objecting to the second ID field, partially blacked out in the image, which is a required field on the SharePoint list. Why would and Update Item action ever fail for this. It should not be.
 
The message seems to suggest there already is duplicate values in the SharePoint list, but I am getting this message on every ID it is trying to update. This column is set to not allow duplicates, but it should not be attempting to create a new record on this list.
 
I use Update Item in a couple of other flows that update this same list using both ID's, without issue.

 

jmfillman_0-1676618205095.png

 

Not sure if this matters, but the Update Item that works (below image), the Inputs section, only lists the list item ID, in the Inputs section, although multiple fields are being updated, where as with the Update Item that is failing(above image), all the fields being updated are listed in the Inputs section.

 

jmfillman_2-1676621867954.png

Categories:
  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @jmfillman 

      

    The problem is that you turned on the Enforce Unique Values feature when setting up the column.

    When this function is turned on, you cannot use the existing field value to update the field of other items. You need to turn this feature off.

    vliweimsft_1-1676625121885.png

     

     

    Best Regards,

    Levi

     

  • jmfillman Profile Picture
    46 on at

    I use Update Item on the same list in multiple other MS Flows, with no issues.

  • jmfillman Profile Picture
    46 on at

    I also used Update Item in an earlier version of this same flow that worked but ran too long. The main difference is that I am using a Get Items inside an Apply to each loop to a Select, and then Update Item, where as before I had a nested Apply to each, that was doing the Update Item. Really trying to avoid the nested Apply to each looping.

     

    The highlighted Update Item is where I get the error.

    jmfillman_0-1676658453465.png

     

    This Update Item, from another flow (updates the same list), works, but has the nested Apply to each that I am trying to avoid.

    jmfillman_1-1676658611443.png

     

  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @jmfillman 

      

    Could you please provide a screenshot of the edit page for the update item?

    If you want to update all items returned by Get items, apply to each cannot be avoided.

     

    Best Regards,

    Levi

  • Verified answer
    jmfillman Profile Picture
    46 on at

    Thank you for taking a look! I have resolved this.

     

    You can indeed use a Select statement to avoid a nested Apply to Each loop. I had a mismatch between the two ID's, generating the error.

     

    Awhile back, I came across an example of the use of a Select statement to avoid a second Apply to each loop and, when I set my variables correctly, cuts down on flow run time.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard