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?
Solved! Go to Solution.
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
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
There should be nothing other than SubmitForm(SharePointForm1). Anything else should be in the OnSuccess property of the form.
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".
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
199 | |
100 | |
61 | |
59 | |
58 |
User | Count |
---|---|
254 | |
164 | |
91 | |
79 | |
70 |