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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change a combo box val...
Power Apps
Unanswered

Change a combo box value by clicking a button

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm making a form for contract management in PowerApps.

I have an edit form with only one list, called 'Contracts'. When the user adds a new contract using the form, he can input various information such as 'Amount', 'Customer', 'Date', 'Status', etc. Once submitted the form, the contract information will be added in the list 'Contracts'.

Admin users can access to an Approval Section, where they can approve the contracts which status is "Waiting for Approval" by clicking a button.

Can anyone point me out a solution in order to change the contract 'Status' in the combo box and in the list from "Waiting for Approval" to "Approved" by clicking this button?

Thank you in advance!

Categories:
I have the same question (0)
  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    Hello @Anonymous ,

     

    You can use "Patch()" to change the value of an existing record.

     

    Patch(
     source,
     existingRecord,
     {choiceColumn:{Value:newValue}}
    )

     

    • source is the name of your SharePoint list
    • existingRecord is the record you want to change (use "LookUp()" or any other method to retrieve the full record you want to change)
    • choiceColumn is your "status" column you want to change. As it is a choice-type column, its new value must be referred as a record « {Value : newValue} »

     

    Hope this was helpful to you.

  • Community Power Platform Member Profile Picture
    on at

    Hello, thank you for your reply! The solution you pointed me out makes a lot of sense, but I'm getting an error in this part of the code:

    {choiceColumn:{Value:newValue}}

    I put 'Status' as 'Value' and I don't know what I can insert as 'choiceColumn'

  • WiZey Profile Picture
    3,023 Moderator on at

    Hello,

     

    choiceColumn is the name of the column you want to give a new value. Assuming it is a choice-type column, it's value must be a record like « {Value : newValue} ».

    Value is the property name of the choiceColumn you want to update. This is the default name from SharePoint, you don't have to change it.

    newValue is the new value you want to update your column with. To change the value to "Approved", just tap "Approved" instead of newValue.

     

    {Status:{Value:"Approved"}}

     

    By the way, I assumed "Status" was a choice-type column, but if it turns out your "Status" is a text-type then you can simply use this:

     

    {Status:"Approved"}

     

  • Community Power Platform Member Profile Picture
    on at

    Hi, I tried to do it:

     

    {Status:{Status:"Approved"}}

     

    but it appeared this kind of error: 

     

    Invalid argument type. Expecting a record value, but from a different schema.

    Missing column. Your formula is missing a column 'Value' with a type of 'Text'.

     

    Thank you in advance

  • Verified answer
    v-yujincui-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    I agree with what @WiZey said, the formula provided by @WiZey should work.

    I see that you seem to be stuck, but I didn't want to plagiarize the answer, so I made a slightly more detailed test for your reference.

     

    1. Here is my SharePoint List.

    vyujincuimsft_0-1659604183500.png

    2. Here is my App.

    I added a Button Control to the Data Card corresponding to the Status column.

    Combo Box(Choice Column)-->DisplayMode:

    DisplayMode.Disabled

    Button-->Visible:

    If(User().Email=Admin's Email,true,false)

    Button-->OnSelect:

    Patch(DataSource,ThisItem,{ChoiceColumnName:{Value:"Approved"}})

    vyujincuimsft_1-1659604562095.png

    Result Screenshot:

    vyujincuimsft_2-1659605030071.png

     

     

     

    Best Regards,
    Charlie Choi

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard