cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

unable to patch choice column in SP list

 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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

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

Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

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"}
)
)

Community Support
Community Support

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,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,771)