cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Poseidon10
Helper I
Helper I

Not Navigating correctly after submitting

I have a powerapps from a custom SharePoint list.  When I create a new form, and click Save I have this formula in OnClick: SubmitForm(SharePointForm1); If(DataCardValue32.Selected.Value="Draft", Navigate(Screen2_1), Navigate(Screen2))

 

However it is not navigating to Screen2_1.  But this only happens when I do a new form.  If I go back in and edit the form and click Save, it works.  I am not sure what is causing this.  I've tried putting that same formula in OnSuccess, OnSave, it doesnt matter.  When its a new form it always goes to Screen2 but if I go back into the form and click save again it works.  Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
phipps0218
Memorable Member
Memorable Member

Rather than using DataCardValue32.Selected use SharePointForm1.LastSubmit.TheStatusValue.

The reason this is happening is because when you use Submit, it actually clears that datacard value. Alternatively, you can set a variable before submit and then use the variable value within you IF Statement. 

 

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
Subscribe to my YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg

View solution in original post

5 REPLIES 5
phipps0218
Memorable Member
Memorable Member

Rather than using DataCardValue32.Selected use SharePointForm1.LastSubmit.TheStatusValue.

The reason this is happening is because when you use Submit, it actually clears that datacard value. Alternatively, you can set a variable before submit and then use the variable value within you IF Statement. 

 

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
Subscribe to my YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg

Drrickryp
Super User
Super User

@Poseidon10 

There should be nothing other than SubmitForm(SharePointForm1).  Anything else should be in the OnSuccess property of the form.  

@Drrickryp , i tried OnSuccess and it didnt work there either.

Drrickryp
Super User
Super User

@Poseidon10 

As @phipps0218  suggested, you need to capture the value: DataCardValue32.Selected.Value as a variable before you submit the form.  I suggest in the OnChange property of the control DataCardValue32 put Set(var, DataCardValue32.Selected.Value).  Then in the OnSuccess property you can use your If() statment

 If(var="Draft", Navigate(Screen2_1), Navigate(Screen2))

If you do that, make sure the Default for the control is not "Draft". 

 

Poseidon10
Helper I
Helper I

It worked.  I created a variable that when selected.value was "Draft", I would set a variable to draft, the on success if the variable equals draft, it would navigate correctly.  Thanks all.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,944)