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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Power Apps Edit Command bar Javascript Issue

(1) ShareShare
ReportReport
Posted on by
Hi I added a button using the modern command edit bar feature in power apps website.
 
the issue if the button calls a JS function and the first 2 lines of JS code is to get execution context. (below two lines)
 
function triggerOnDemandWorkflow(executionContext) {
    var formContext = executionContext.getFormContext(); 
 
 I get undefined error when it gets the context variable. any help is appreciated. the JS code is to call a workflow to run when a button is clicked.
 
there is no field change so how do i pass execution context in this scenario?
 
any help on this one??
I have the same question (0)
  • Suggested answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Power Apps Edit Command bar Javascript Issue
    Hi,
     
    You need to use the primaryControl parameter instead of the executionContext parameter to pass context information.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    Power Apps Edit Command bar Javascript Issue
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 179

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 127 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans