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

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
Highlighted

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.

View solution in original post

4 REPLIES 4
Highlighted
Solution Sage
Solution Sage

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.

Highlighted
Community Support
Community Support

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.
Highlighted
Frequent Visitor

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.

 

 

Highlighted

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.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,781)