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

Navigate to screen based on the field value

Hi All,

I'm trying to navaigate the powerapps screen based on the value in the 'status' column.

I'm checking the condition on 'Onstart' event, but nothing is happening.

I'm using below conditon.

 

If(DataCardValue66.Selected.Value="Approved",Navigate(Screen1,ScreenTransition.Fade))

'DataCardValue66.Selected.Value' will have the value of status column.

 

Is it the correct apporach?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Navigate to screen based on the field value

Hi @Harikrishnan,

I think you have some misunderstanding with the OnStart property of the FormScreen1 of the custom form of your SP list.

There are some limitations in SharePointIntegration control within custom form of SP list. The properties for the SharePointIntegration control may not be available in OnStart or OnVisible of FormScreen1 of the custom form of your SP list.

In addition, the OnStart property of the FormScreen1 of the custom form could only be fired once when the list is loaded. In other words, when you open the app (custom form) via clicking "New" button, "Edit" button or "Edit" button, the OnStart event would be fired. After that, when you click "New" button, "Edit" button or "Edit" button again within your SP list, the OnStart event would not be fired.

More details about the limits in SharePointIntegration control, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/sharepoint-form-integration#customize-t...

As an alternative solution, you could consider take a try to add your If formula within the OnEdit or OnView property of the SharePointIntegration control as below:

OnEdit:

Refresh('YourSPList');   /* <- Add formula here */
EditForm(SharePointForm1); If(SharePointIntegration.Selected.Status.Value = "Approved", Navigate(Screen1,ScreenTransition.Fade)) /* Add formula here*/

OnView:

Refresh('YourSPList');  /* <- Add formula here */
ViewForm(SharePointForm1); If(SharePointIntegration.Selected.Status.Value = "Approved", Navigate(Screen1,ScreenTransition.Fade)) /* <- Add formula here */

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
TimRohr
Level 10

Re: Navigate to screen based on the field value

Typically  you could do this, but I don't think you can use Navigate() in the OnStart event. I think it's the same logic that keeps you from being able to Navigate() in the OnVisible event of a form. (Pitfalls of a WYSIWYG editor.)

 

In a similar situation, I have used a Timer control with a duration of 1ms that fires the necessary code to navigate. More brutish than optimal, but it gets the job done.

Community Support Team
Community Support Team

Re: Navigate to screen based on the field value

Hi @Harikrishnan,

Could you please share a bit more about your scenario?

How do you run your app? Using a PowerApps app URL link or open/run your app manually?

Further, do you custom a form for your SP list using PowerApps?

If you run your app from your PowerApps, I think there is something wrong with your formula. When you run your app first time, the Data forms (Edit form and Display form) would not be initialized, so the DataCardValue66.Selected.Value formula would return blank/null.

If you run your app from the custom form of your SP list, please modify your formula as below:

Set the OnEdit property of the SharePointIntegration control to following:

EditForm(SharePointForm1);
If(DataCardValue66.Selected.Value="Approved", Navigate(Screen1,ScreenTransition.Fade))

Set the OnView property of the SharePointIntegration control to following:

ViewForm(SharePointForm1);
If(DataCardValue66.Selected.Value="Approved", Navigate(Screen1,ScreenTransition.Fade))

If you could provide more details about your scenario, we would provide a proper workaround for you.

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Harikrishnan
Level: Powered On

Re: Navigate to screen based on the field value

Hi all,

 

Thank you four reply.

I'm using a custom list form using power apps. So not accessing the form from the powerapps.

 

I'm able to achive this using timer.  Instead of accessing the 'status' from datacard I used sharePoint integration property. So the formula on 'OnTimerEnd' will be 

 

If(SharePointIntegration.Selected.Status.Value="Approved",Navigate(Screen1,ScreenTransition.Fade))

But not sure why this is not working on 'OnStart' event.

 

 

Community Support Team
Community Support Team

Re: Navigate to screen based on the field value

Hi @Harikrishnan,

I think you have some misunderstanding with the OnStart property of the FormScreen1 of the custom form of your SP list.

There are some limitations in SharePointIntegration control within custom form of SP list. The properties for the SharePointIntegration control may not be available in OnStart or OnVisible of FormScreen1 of the custom form of your SP list.

In addition, the OnStart property of the FormScreen1 of the custom form could only be fired once when the list is loaded. In other words, when you open the app (custom form) via clicking "New" button, "Edit" button or "Edit" button, the OnStart event would be fired. After that, when you click "New" button, "Edit" button or "Edit" button again within your SP list, the OnStart event would not be fired.

More details about the limits in SharePointIntegration control, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/sharepoint-form-integration#customize-t...

As an alternative solution, you could consider take a try to add your If formula within the OnEdit or OnView property of the SharePointIntegration control as below:

OnEdit:

Refresh('YourSPList');   /* <- Add formula here */
EditForm(SharePointForm1); If(SharePointIntegration.Selected.Status.Value = "Approved", Navigate(Screen1,ScreenTransition.Fade)) /* Add formula here*/

OnView:

Refresh('YourSPList');  /* <- Add formula here */
ViewForm(SharePointForm1); If(SharePointIntegration.Selected.Status.Value = "Approved", Navigate(Screen1,ScreenTransition.Fade)) /* <- Add formula here */

Best regards,

Kris

Community Support Team _ Kris Dai
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

Top Kudoed Authors
Users Online
Currently online: 122 members 4,604 guests
Please welcome our newest community members: