cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

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

 

View solution in original post

2 REPLIES 2
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

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

 

View solution in original post

v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,287)