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 / Custom button to chang...
Power Apps
Answered

Custom button to change item Status & Status Reason

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All, 

 

I'm trying to implement a custom button on a model driven app that will update the Status & Status Reason. 

 

In the entity I've updated the Status Reason choice to have custom values: 

PetarHr_1-1656507241595.png

 

Now, when I try to implement the solution described in https://jukkaniiranen.com/2021/10/reopen-tasks-with-power-fx-custom-command-bar-button/ I get an error. 

 

PetarHr_2-1656507374788.png

 

Code that I'm using: 

 

 

Patch(EntityName, Self.Selected.Item, {statuscode: 'Status Reason (EntityName)'.'Pending Team Review' ,statecode:'Status (EntityName)'.Active});

 

 

 

The above will work if I use "Active"/"Inactive" for the Status Reason:

 

 

Patch(EntityName, Self.Selected.Item, {statuscode: 'Status Reason (EntityName)'.Active ,statecode:'Status (EntityName)'.Active});

 

 

 

How can I access & set the custom Status Reason values?

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Found a solution thru JS - executing an update action thru Client API (as described here https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference) got the required result. 

     

    Also pro tip - opening the command buttons in the component library and editing the formula there will sometimes give you access to properties, that are not displayed in the IntelliSense of the default command editor.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard