cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TesDA
Level: Powered On

Navigate() not working

I have the below function on a submit button. After the person presses submit (and the logic works out), I'd like it to go to another screen - but its not doing that, its staying on the same screen. How do I get the navigate to work?

 

If(

DateCardEnd.SelectedDate < DateCardStart.SelectedDate, Notify("Start Date must be before or the same as your end date", Warning),
DateDiff(DateCardStart.SelectedDate,DateCardEnd.SelectedDate,Days)>30, Notify("To request more then 30 days please contact HR", Warning),
Now() > DateCardStart.SelectedDate, Notify("Requests must be made for future dates", Warning),
"Sick Time" = LeaveType_DropDown.SelectedText.Value, Notify("Contact your coach for sick leave", Warning),
"Paternity Leave" = LeaveType_DropDown.SelectedText.Value, Notify("Contact HR for Protected Leave", Warning),
"Protected Leave" = LeaveType_DropDown.SelectedText.Value, Notify("Contact HR for Protected Leave", Warning),
"Medical" = Reason_DropDown.SelectedText.Value, Notify("Contact HR for Protected Leave", Warning),
"Parental" = Reason_DropDown.SelectedText.Value, Notify("Contact HR for Protected Leave", Warning),
Len(DataCardValue9.Text)<20 And CoverageNeeded_DropDown.Selected.Value = "Yes", Notify("Make sure to provide at least 2 sentences for your coverage", Warning),
SubmitForm(Status_Form); Navigate(BrowseScreen1, ScreenTransition.Fade);Notify("Your FTO has been submitted ",NotificationType.Success) )

1 ACCEPTED SOLUTION

Accepted Solutions
TesDA
Level: Powered On

Re: Navigate() not working

It turns out that the form OnSuccess was set to back(), which is why the screen always went back to the original screen. Once the back() was deleted from the form, everything worked correctly.

12 REPLIES 12
RezaDorrani
Level 10

Re: Navigate() not working

Hi @TesDA 

 

Looks like all your if statement conditions are setting notifications and only navigates when all conditions are met

 

Do you get any notification on button click?

 

Regards,

Reza Dorrani

 

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

TesDA
Level: Powered On

Re: Navigate() not working

When the button is clicked, the warning logic works correctly based on the if statement. If a person enters information in the form correctly, the form itself correctly submits. The only issue is that the person is not navigated to a different screen. Let me know if this doesn't answer your question. I suspect that the warning is getting in the way.

RezaDorrani
Level 10

Re: Navigate() not working

@TesDA 

 

In your else part of the If statement, set a variable just to see if this gets called

 

SubmitForm(Status_Form); Set(varCheck,"Yes");Navigate(BrowseScreen1, ScreenTransition.Fade);Notify("Your FTO has been submitted ",NotificationType.Success)

TesDA
Level: Powered On

Re: Navigate() not working

I was able to cut and paste it in. How do I check to see if the variable was called?

RezaDorrani
Level 10

Re: Navigate() not working

@TesDA 

 

Go to View -> Variables -> Global

 

You should see your variable there

 

Highlighted
TesDA
Level: Powered On

Re: Navigate() not working

Thanks - looks like its showing yes

 

Variable.jpg

RezaDorrani
Level 10

Re: Navigate() not working

@TesDA 

 

Time for the classic approach Smiley Happy

Save, close your app and restart

Navigate and Notify should work

 

TesDA
Level: Powered On

Re: Navigate() not working

Still not working. Looks like its briefly going to the new page and then going back to the original page and giving the green warning.

Community Support Team
Community Support Team

Re: Navigate() not working

Hi @TesDA ,

According to your formula, I think you lost the last condition.

If(.....,
   Len(DataCardValue9.Text)<20 And CoverageNeeded_DropDown.Selected.Value = "Yes",   //condition
Notify("Make sure to provide at least 2 sentences for your coverage", Warning), //result //...where is the condition?
SubmitForm(Status_Form); Navigate(BrowseScreen1, ScreenTransition.Fade);Notify("Your FTO has been submitted ",NotificationType.Success) //result
)

So if  "Len(DataCardValue9.Text)<20 And CoverageNeeded_DropDown.Selected.Value = "Yes"" is not the last condition, you need to add the last condition before the last action( submitform....;navigate...;notify....).

If "Len(DataCardValue9.Text)<20 And CoverageNeeded_DropDown.Selected.Value = "Yes"" is the last condition,

I suggest you modify the formula like this:

If(.....,
   Len(DataCardValue9.Text)<20 And CoverageNeeded_DropDown.Selected.Value = "Yes",   //condition
   Notify("Make sure to provide at least 2 sentences for your coverage", Warning);   
   SubmitForm(Status_Form);
Navigate(BrowseScreen1, ScreenTransition.Fade);
Notify("Your FTO has been submitted ",NotificationType.Success) //result )

 

Best regards,

Community Support Team _ Phoebe Liu

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

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

Users Online
Currently online: 193 members 4,705 guests
Please welcome our newest community members: