Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to get an On Change Event to fire from a programmatic change

(1) ShareShare
ReportReport
Posted on by 32

Hi all, 

I have a scenario where I need an on change event to fire from a programmatic action. 

I have an expenses form which follows an approvals process through teams via a flow. 

When the user approves the expenses the decision is then updated by the flow in the decision field for the relevant table, but unfortunately the onchnage event is not firing from this, only when the field in the form is manually changed. 

From reading online I understand I need to use the fireOnChange method, but I am unsure of how and where I am to use this. 

Any guidance would be greatly appreciated.

My onChange event is as follows: 

function Expenses (executionContext) {
var formContext = executionContext.getFormContext();

var decision= formContext.getAttribute("decision").getValue()[0].name; //note this is a look up field 

if(decision== "Accepted") {

<Expenses Code>

}

}

  • HK Profile Picture
    HK 32 on at
    RE: How to get an On Change Event to fire from a programmatic change

    Thanks for the explanation, very useful!

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: How to get an On Change Event to fire from a programmatic change

    Hello,

    What you are talking about is "Client-Side" so it can't handle updates from a Power Automate because updates from Power Automate are happening on the backend.

    There are a few ways in order to make it work for you but all of those are "Server-Side":

    * another one power automate flow that handles updates of the "Decision" field

    * workflow that handles updates of the "Decision" field

    * plugin that handles updates of the "Decision" field

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,401 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans