cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
itgirl92
Level: Power Up

OnCancel Function Not Firing

I have a simple PowerApps form that is creating a new list item.

 

My goal is that I want them to click a button, launch the window to create the New Item, then return to the place it was launched from.

 

Upon Cancel or Save from the New Item form, it was returning to the list screen.  This is NOT where I want them to go.  I don't want them to see this list screen.  Just the screen with the buttons and the form.

 

I've gotten the functionality to work when they click SAVE to taken them to a "Thank You for Your Submission" page and then they can link back to the main page they started at.

 

However, I cannot get this to work OnCancel.  I've tried everything.  OnReset, OnFailure on the Form, still returns to the list page.  OnHide doesn't allow me to use Navigate to go to a different screen.  Everything I try - Navigate or Launch - returns to the page for the List. 

 

Ideally, I want it to return to the page they came from, but I'm willing to forego that if I can at least take them to a page I create that doesn't have all the list entries on it.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: OnCancel Function Not Firing

Hi @itgirl92 

 

I believe the cancel button has an inherit RequestHide() action which is cannot be updated

 

Your best bet would be to provide the user with a cancel button on the form itself which will allow you to navigate to a different screen

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

2 REPLIES 2
Super User
Super User

Re: OnCancel Function Not Firing

Hi @itgirl92 

 

I believe the cancel button has an inherit RequestHide() action which is cannot be updated

 

Your best bet would be to provide the user with a cancel button on the form itself which will allow you to navigate to a different screen

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Community Support Team
Community Support Team

Re: OnCancel Function Not Firing

Hi @itgirl92 ,

Do you want that if you click "Cancel" button, you will not navigate to the list form and stay in the edit form?

Firstly, there's no OnCancel function in PowerApps currently.

I suggest you insert two buttons in the edit form screen.

One for "SAVE" and one for "CANCEL".

Usually, if you click the save button, the form will be submitted and you will back to the list screen.

If you click the cancel button, the form will not be submitted, all the data in the form will be cleaned and you will stay in the edit form screen.

So try this:

1)set the save button's OnSelect:

SubmitForm(Form1);Back()

2)set the cancel buttton's OnSelect:

Reset(Form1)

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 268 members 4,423 guests
Please welcome our newest community members: