cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Muzammil
Frequent Visitor

Screen Navigate - Not working on Form's OnSuccess

I'm using a Form and a Gallery both in my App for Master/Detail SharePoint List updates.

Form submit a record to "Daily Fish Catch Master" SharePoint Master List, and Gallery updates the record to "Daily Fish Catch Detail" SharePoint Detail List.

 

Challenges:

The code I have On submit is "SubmitForm(FormDailyFishCatchMaster)" and "OnSuccess" of this form I'm using Patch to patch the Gallery items to the SharePoint's detail list. Everything works well till I add the "Navigate" to Success Screen after Patch Code, it's not working and even when I use "Navigate" function, it stops adding the Gallery items to Detail SharePoint list, just update the From list's items in SharePoint.

 

I have attached the screenshots for your review, thank you in anticipation 🙂

3 REPLIES 3
iAm_ManCat
Super User II
Super User II

Hi,

 

Can't answer why it's not navigating, although I suspect its a timing issue. Could you try creating a Timer, running for 1000 (1 second), then set your OnSuccess for the form to Start the timer (best way to do this from experience is to set to false, and then set to true, not just set to true) and then set the OnTimerEnd to your Navigate and ResetForm.

 

Let me know if this helps,

 

Cheers,

ManCat

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


K-A-R-L
Solution Specialist
Solution Specialist

Hi @Muzammil ,


Just a suggestion:


Have you tried compiling your OnSuccess  codes and Submit Form as one in the OnSelect Property of the Submit Button? Any reason why you need to separate the two codes?

You can try:

Adding the code below to your OnVisbile Property of your HomeScreen:

Set(NewForm, true);

Add this to your OnSelect in Submit Button:

If(NewForm = true, 
<<---Add all your OnSuccess Code here Except the Navigate() and Reset()---->>
;
SubmitForm(EditForm);
Navigate(SuccessScreen,None);Reset(FormDailyCatchMaster))

 Please read the same issue on this post: https://powerusers.microsoft.com/t5/General-Discussion/Navigate-to-screen-A-if-adding-a-record-othe...

 

----------------------------------------------------------------------------
Thanks,
K-A-R-L


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.

You should never do those things together, it's best practice to separate them - and I'll give you a good user story example why (this has happened to me).

 

Let's say there's a validation error on your form,

   then the email will send when you click submit, with invalid values,

       but the form will not submit,

   then you will edit the form and correct the issue,
       click submit, but another validation issue,

       the email will send again, with invalid values,

       but the form will not submit,

   then you fix all the errors, click submit,

       the third copy of the email will then send, a correct version

       and your form will submit

 

by this time the recipient has three emails all with differing data, which one do they use?

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


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 is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (57,141)