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 / Model-driven App Busin...
Power Apps
Answered

Model-driven App Business Process Flow: Move to a prior stage after providing reason

(0) ShareShare
ReportReport
Posted on by 33

Hello,

 

Let me start by stating that I have done very limited JavaScript and have only used it in the scope of model-driven apps. I have a requirement from a customer for users to provide a free-text reason before moving to a previous stage in a business process flow of a model-driven app. 

 

The concept here is that the target record uses a BPF to traverse through various travel approvals, with different audiences approving at each stage. If an approver finds an edit that needs to be made (i.e. need more location details, invalid cost center, etc.) they send the record back to the appropriate stage to have the edits made. My customer wants the app to require that some type of free-text reason or notes record be provided/added before sending a record back to a previous stage so that the approver/submitter of this previous stage knows why the record was moved back. Has anyone built out a solution for this concept in a model-driven app? 

 

Complexity of this table is very high, so we are not open to creating a custom canvas app just to handle this particular scenario.

 

I've been reading about the JavaScript OnStageChange Event, which I am thinking is a good starting point, but I am not sure how I would implement it, especially with the added complexity of using this event to trigger some type of pop-up or new field requirement before the record moves back to the previous stage. 

 

I'd be very grateful for any guidance on implementing the above JS or even any alternative solution that is possible in the scope of a model-driven app. Happy to provide more detail if needed!

I have the same question (0)
  • Verified answer
    Ballard297 Profile Picture
    33 on at

    Solved my own issue with the help of a couple guides 🙂

     

    I achieved this with minimal JavaScript by leveraging the Custom Pages component. I basically adjusted the below guide to my use case, and it worked like a charm:
    How To Make Dialogs For Model-Driven Apps Using Custom Pages – Dianamics PCF Lady (wordpress.com)

    To clean it up further, I then restricted backward movement of the BPF stages with an adjusted version of the script provided by this guide:

    Restrict Manual Movement Of Stages Using JavaScript in BPF (c-sharpcorner.com)

     

    Shout out to Dianamics and C# Corner for the help!

  • magneto_19 Profile Picture
    2 on at

    Hey How did you manage to move the business process flow to a previous stage.
    It would be really helpful if you could provide a detailed explaination.

     

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @BenDenBlanken also provides a wonderful solution using Power Automate which I have used for a couple of model driven apps. It highly customizable based on your needs.

     

    https://www.bendenblanken.com/automagically-update-the-bpf-stage-based-on-the-approval-outcome/

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard