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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (1,944)