Hi Community!
Although there are several posts about saving data out of Power Apps and into SharePoint, I have been unable to find my exact scenario.
It's an awards site, and people are inputting nominations. After they input their nomination, they need to be redirected to a "thank you" page (or screen - just something that says "Thanks!") and then offered a chance to either nominate another person or leave the site.
THE SETUP:
Basic SharePoint list, the nominee names are from a lookup column while the nominations are just multi-line text fields.
The canvas app is just four screens, three of the screens have NEW forms on them to capture the nominations, and the fourth screen is just a 'Thank You' message along with a button that launches the home page of the site. (Originally, I had tagged on the 'Launch(Site_Home_Page.aspx)' in the Submit button, but since that wasn't working, I thought maybe another screen would help. )\
NOTE: The screens are deep-linked and each using the PowerApps webpart displaying inside of a SharePoint page. Each link is tied to a button on the home page.
In the 'Save Nomination' button's OnSelect:
SubmitForm(BoldDecisiveForm); ResetForm(BoldDecisiveForm)
In the Form's OnSuccess:
Navigate(HubScreen) (for the 'Thank You' message)
WHAT'S HAPPENING:
All data saves to the list perfectly, by the way. There's no problem there. When the user clicks 'Save Nomination' button, the form resets, the 'Thank You" message on the HubScreen displays. If they DO want to submit another nomination, there's a button on the HubScreen that simply does a "Launch('Site_Home_Page'). It does this in a new browser tab, while leaving the PowerApp tab running. If the user tries to close the tab where PowerApps is sitting, it gives a message "Leave site? Changes you made may not be saved.".
This happens whether a site page is launched at the end OR navigated to another screen within the app. It seems like once the form is reset, it's sitting and waiting for new data; therefore, the browser thinks that new data is incoming and isn't saved yet. The browser message makes the end user think their nomination wasn't saved and...you can imagine.
I've tried swapping around the commands, changing the order, moving them between OnSuccess (in the form) and OnSelect (in the button) . The command for 'LaunchTarget.Replace' doesn't work - it actually causes the form to lock up.
This project is now due next week, and I only just noticed this behaviour. Is there any suggestion I can use to get the form to maybe reset, but don't ask for new data, or something? Am I on the right track?
Thanks, guys and gals! You've saved me so many times!
~ Tracy H