cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sharon091
Helper II
Helper II

Canvas app Onstart check condition

Hi,

 

I have a Canvas app embedded in the Model driven app. On start or onload of the app I need to check if the Status reason field contains value Completed then Navigate to Acknowledgement form otherwise to Screen1.

 

If(DataCardValue7.Text="Completed",Navigate(Acknowledgement,ScreenTransition.Fade),Navigate(FormScreen1,ScreenTransition.Fade))

Where should I place this code? It doesn't work if I place it on App OnStart function or on Screen1 OnVisible property.

 

Kindly help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Microsoft
Microsoft

Hi @Sharon091 ,

 

I think the Timer control can solve your problem.

Every 100ms the control will automatically determine whether the value of DataCardValue7 is "Completed", and if it is, it will jump to another page.

 

Please try the steps below:

1\ Add a timer control and set its OnTimerEnd property to:

If(DataCardValue7.Text="Completed",Navigate(Acknowledgement,ScreenTransition.Fade),Navigate(FormScreen1,ScreenTransition.Fade))

 

2\ Modify its other properties as shown below

185.PNG

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

4 REPLIES 4
LRVinNC
Super User
Super User

App - On Start actions take place before launching your first screen.  Normally that would be a good place to make a decision on which screen to display.  However, you are trying to make that determination based on a form that hasn't even been loaded when the App - On Start takes place.

So, since you can't currently set the first page from On Start, the first screen in your list is going to automatically load.  

You don't specify where DataCardValue7.Text is located or how you are populating it prior to trying to make this check.  Can you provide some additional detail on your logic so we can better help you?

LRVinNC

------------------
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi,

I have a survey form on the canvas app embedded in model driven app. The first time user submits the survey I'm updating the status reason to completed and navigating the user to Acknowledgement screen. Its stored in DataCardValue7 on Screen1. Any time again if user clicks on the record he should be automatically redirected to Acknowledgement screen since he has already filled the survey.

StalinPonnusamy
Helper III
Helper III

My recommendation is to display the acknowledgement information on survey screen itself once survey is filled with simple toggle to show/hide.

 

Other option is show button once survey filled, so that user can navigate on click.

 

v-xiaochen-msft
Microsoft
Microsoft

Hi @Sharon091 ,

 

I think the Timer control can solve your problem.

Every 100ms the control will automatically determine whether the value of DataCardValue7 is "Completed", and if it is, it will jump to another page.

 

Please try the steps below:

1\ Add a timer control and set its OnTimerEnd property to:

If(DataCardValue7.Text="Completed",Navigate(Acknowledgement,ScreenTransition.Fade),Navigate(FormScreen1,ScreenTransition.Fade))

 

2\ Modify its other properties as shown below

185.PNG

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (47,064)