cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtx20190
New Member

PowerApp Canvas button to change an activity statuscode/statecode

there is an Entity of Activity type and it has a statecode, statuscode and other optionset fields;

i want to make a button that onselect it'll change the status to approved/canceled .

i tried somehow to do it through "canvas code" but it says that it doesnt support optionset values

how do i connect the button to make it do it ?

through code or power automate ?

How?

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Dual Super User
Dual Super User

Hi @mtx20190 ,

You can refer the option set values with 'NameofOptionSet/Column (NameofTable)'.

Here is an example where the Status column is an Managed ChoiceOptionSet. To update the value of this column in a particular row to Inactive, you can use this: 

Patch(
    Asset_BaseObjects,
    LookUp(
        Asset_BaseObjects,
        Name = "Something"
    ),
    {Status: 'Status (Asset_BaseObjects)'.Inactive}
)

 Hope it helps !

View solution in original post

2 REPLIES 2
gabibalaban
Dual Super User
Dual Super User

Hi @mtx20190 ,

You can refer the option set values with 'NameofOptionSet/Column (NameofTable)'.

Here is an example where the Status column is an Managed ChoiceOptionSet. To update the value of this column in a particular row to Inactive, you can use this: 

Patch(
    Asset_BaseObjects,
    LookUp(
        Asset_BaseObjects,
        Name = "Something"
    ),
    {Status: 'Status (Asset_BaseObjects)'.Inactive}
)

 Hope it helps !

askondo
Community Support
Community Support

@gabibalaban Thanks for always making the forums so much fun! I appreciate it.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,684)