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 / Single Screen with Mul...
Power Apps
Answered

Single Screen with Multiple Buttons intended to Save/Submit changes and then navigate to two different screens depending on button pressed

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello and Good Day, Everyone,

 

Yesterday, I asked my question below in an older thread thinking that the topics were related [Multiple functions on one button], but I'm a bit new to this forum experience in general and a fellow responder, @Drrickryp, suggested I create a new thread so here it goes!

 

In my app there is an Edit Screen with (4) buttons: [Save], [Cancel], & two that are used for [Navigate to Email Screen] purposes. I've located the OnSuccess: "( ) Back" function which helps direct the first two standard buttons properly, but the two other buttons that should direct the user to an Email Screen end up Back at the same page as the other two buttons were directed to (Previous Screen).

 

So, the question I have is this: Is it possible to either create a second OnSuccess function, total of 2, the first to default ( ) Back while the second one is for Navigate(Email Screen) within the same Edit Screen? Or should I insert an IF statement based on which button was used?
Note: I've spent quite a bit of time searching this community and I've found a suggestion to use variables specific to which button is pressed. My concern with using the second idea is that I do not see how that saves any changes which need to be brought over to the Email Screen.

 

This is what I have within the OnSuccess for the form (each button's OnSelect feature includes the Set(varNav) correctly to match):

If(varNav = "Navigate",

   Navigate('Email Screen'),

If(varNav="ReviewScreen",

   Navigate('Review Screen'),

ResetForm(EditForm1)));

Please let me know what I need to do differently as this does not work at all, to navigate or save changes.

Thanks!

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    What is the condition addressed in the form, that determines whether the screen navigates to the email screen or stays on the same screen, perhaps to put the form in view mode?  Like is a checkbox ticked or is a certain dropdown value selected.  It relates to how you decide to Set varNav.

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Well, that connection ended up arriving late...

    I added a SubmitForm at the end of the above OnSelect feature and it's behaving as I expected.

    Just in case there happens to be any others out there this is what the button's OnSelect function property looks like:
    Set(varNav, "Navigate");
    SubmitForm(EditForm1)

    OnSuccess:
    If(varNav = "Navigate",
    Navigate('Email Screen'),
    If(varNav="ReviewScreen",
    Navigate('Review Screen'),
    ResetForm(EditForm1)));

     

    Note: Be sure to add the "SubmitForm" function code to all buttons with the variable - I missed that in my other set to start with, but once that is added it is working as expected.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    The above does not address my question.  How do you determine which button to press when you want to submit the form?  It may be possible to automate the process and use a single button to submit the form.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    *Updated for a Clearer Response*

    On the Edit Form there are 2 sets of buttons; default Save / Cancel, and two buttons which appear visible during specific stages to send an emails to related parties. My changes with adding the SubmitForm to all of the buttons sets OnSelect operations, have enabled them to submit the changes made to the SP form before moving to another screen. My difficulty was capturing the changes when using the email buttons as I needed the EditForm's inputs to be carried over to the Email Screen.

     

    Hope this makes easier sense to follow! Let me know if there are any other questions. Thanks to an earlier post somewhere in this forum using an IF statement along with Set variables (I would have identified the post with the specific contributor, but I ended up clearing my web history in the meantime)!

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    NP, good luck!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard