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 / Update a choice field ...
Power Apps
Answered

Update a choice field value inside an UpdateIf condition

(0) ShareShare
ReportReport
Posted on by 1,712

Hello,

I have a button that should update two columns in an SP List, one of the columns is a single line of text and the other is a status column and its type is Choices that contains the following values (Open, Pending, Approved, Rejected).

I have tried to use the following formula:

If(
 VManager2,
 UpdateIf(
 'Purchase Order I',
 ID = SelectedReport.ID,
 {SecondMangSign : "Signed"}, ID = SelectedReport.ID, {Status:{Value: "Approve"}}
 ),
	 UpdateIf(
 'Purchase Order I',
 ID = SelectedReport.ID,
 {FirstMangSign : "Signed"}, ID = SelectedReport.ID, {Status:{Value: "Pending"}}
 )
 );

The first field was updated successfully, but unfortunately, the status column doesn't take effect to update the value based on what I have entered in the formula above.

Can please someone explains in detail and provide an example to achieve the above scenario inside the UpdateIf Condition?

Any help will be greatly appreciated.
Thank you!

Categories:
I have the same question (0)
  • timl Profile Picture
    36,774 Super User 2026 Season 1 on at

    Hi @Julien2 

    I think that you're close. To patch a SharePoint choice column, you effectively need to patch a 'record' to your status field and the schema of this record requires us to specify a field called '@odata.type'.

    The syntax you would use would look something like this:

    If(
     VManager2,
     UpdateIf(
     'Purchase Order I',
     ID = SelectedReport.ID,
     {SecondMangSign : "Signed"}, ID = SelectedReport.ID, 
     {Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Value: "Approve"}}
     ),
    	 UpdateIf(
     'Purchase Order I',
     ID = SelectedReport.ID,
     {FirstMangSign : "Signed"}, ID = SelectedReport.ID, 
     {Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Value: "Approve"}}
     )
     );

     

    Here's another post with some example syntax:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-Save-Choice-field-value-using-UpdateIf-Patch-functions/td-p/28338 

  • EBMRay Profile Picture
    1,712 on at

    Hello @timl ,

    Thanks for providing an example.

    I have tried to use exactly the same formula as you mentioned, but unfortunately, the status column doesn't update based on the value that I have provided, and again only the FirstMangSign and SecondMangSign fields text are updated.

    Please have a look at the following screenshots:

    Capture2.JPGResultsResults
    Why do you think this problem occurs? Should I provide the DataCardValue53 instead of Value and use at the end of the function SubmitForm(Form1) or it's not the reason?

    I have also tried to include the ID of the status value with no hope:

     If(
     VManager2,
     UpdateIf(
     'Purchase Order I',
     ID = SelectedReport.ID,
     {SecondMangSign : "Signed"},ID = SelectedReport.ID, {Status:{
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id: 3,
     Value: "Approved"
     }}
     ),
    	 UpdateIf(
     'Purchase Order I',
     ID = SelectedReport.ID,
     {FirstMangSign : "Signed"},ID = SelectedReport.ID,
     {Status:{
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id: 1,
     Value: "Pending"
     }}
     )
     );


    Looking forward to your response.
    Thank you!

  • Verified answer
    timl Profile Picture
    36,774 Super User 2026 Season 1 on at

    Hi @Julien2 

    Sorry for the delay in responding. Could you try this syntax to see if works better?

     

    If(
     VManager2,
     UpdateIf(
     'Purchase Order I',
     ID = SelectedReport.ID,
     { SecondMangSign : "Signed", 
     Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Value: "Approve"}
     ),
     UpdateIf(
     'Purchase Order I',
     ID = SelectedReport.ID,
     {FirstMangSign : "Signed", 
     Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Value: "Approve"}
     )
     )
    
    

     

  • EBMRay Profile Picture
    1,712 on at

    Hello @timl ,

    No need to be sorry for your delayed response. The syntax that you mentioned makes it works as expected.

    Thank you for your support!

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard