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 Apps / unable to patch choice...
Power Apps
Answered

unable to patch choice column in SP list

(0) ShareShare
ReportReport
Posted on by 118

 Hi,

Trying to patch the existing SP list record choice column with the attached command but unable to get the result

 

After execution the gethelp on error shows "The specific record was not found" though SP list has the record with status"Reported".

 

Appreciate a quick help

ChoicePatch.png
SPlistRecord.png
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,427 Most Valuable Professional on at

    Try the following code instead

    ForAll(
     Filter(
     GalleryReported.AllItems,
     Status.Value = "Reported"
     ),
     Patch(
     Mobility,
     ThisRecord,
     {Status: {Value: "Approved"}}
     )
    )

    Since Status is a Choice column you have to patch it with an object record.  {Value:"Approved"} will set the value property of the Status record.

  • shoebwk Profile Picture
    118 on at

    Getting the same error {attached}

    I can also see the Internal Field name for Status column is
    /_layouts/15/FldEdit.aspx?List=%7B6BF7CC6C-A494-4A9C-A242-983541A87B83%7D&Field=pcof

    errorChoicepatch.png
  • Pstork1 Profile Picture
    69,427 Most Valuable Professional on at

    Change it to use the internal field name.  I tested it on a choice column in one of my lists where the internal name is 'status' and it works for me.

  • shoebwk Profile Picture
    118 on at

    I am not sure why it is not work.

    Here I removed the complex column dependencies and now both the columns in powerapps in SP list are text field. Still I am getting the same error

     

    ForAll(
    Filter(
    GalleryReported.AllItems,
    ApprovalStatus = "Reported"
    ),
    Patch(
    Mobility,
    ThisRecord,
    {ApprovalStatus:"Approved"}
    )
    )

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @shoebwk ,

    Could you tell me:

    1)status field data type?

    2)what does "ThisRecord" represent? a variable ? or something else?

    If you want to update all the items that ApprovalStatus = "Reported" to ApprovalStatus:"Approved", you should use formula like this:

    ForAll(
     RenameColumns(
     Filter(
     GalleryReported.AllItems,
     ApprovalStatus = "Reported"
     ),
     "ID","ID1"),
     Patch(
    Mobility,
    ID=ID1,
    {ApprovalStatus:"Approved"}
    )
    )

    If Status is single choice column, try this formula:

    ForAll(
     RenameColumns(
     Filter(
     GalleryReported.AllItems,
     Status.Value = "Reported"
     ),
     "ID","ID1"),
     Patch(
    Mobility,
    ID=ID1,
    {Status: {Value: "Approved"}}
    )
    )

     

     

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 899

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 499

Last 30 days Overall leaderboard