cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Harikrishnan
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

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
TimRohr
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.

v-xida-msft
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.
Harikrishnan
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.

 

 

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
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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,387)