cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
halifaxious
Resolver II
Resolver II

embedded canvas app ignores App.onStart

I have a 3 screen embedded canvas app that records the answers to questions. If all the questions have previously been answered and stored in Dataverse, the third screen should display. Otherwise, the app should start on the first screen.  I put this code in App OnStart:

ClearCollect(ResponseCollection,
Filter('PRA Scores',ThisRecord.'Primary Risk Assessment'.Activity=[@ModelDrivenFormIntegration].Item.Activity)
);
Set(saveable,IsEmpty(ResponseCollection));
If(!saveable,Navigate(RecommendationScreen,ScreenTransition.None));

If I play the app from canvas studio, it navigates to the 3rd screen as expected.  But when the app plays from inside my model-driven app, the 1st screen is always displayed.  How do I make my embedded canvas app behave as desired?

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @halifaxious ,

 

I guess that the onstart property does not work because onstart is triggered before ModelDrivenFormIntegration].Item.Activity .

I suggest you use Timer control' OnTimeEnd property instead of Onstart property.

 

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

 

View solution in original post

3 REPLIES 3
v-xiaochen-msft
Community Support
Community Support

Hi @halifaxious ,

 

I guess that the onstart property does not work because onstart is triggered before ModelDrivenFormIntegration].Item.Activity .

I suggest you use Timer control' OnTimeEnd property instead of Onstart property.

 

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

 

View solution in original post

ChadAlthaus
New Member

Another suggestion is to place all the logic depending on the ModelDrivenFormIntegration object into a hidden toggle control to avoid using an arbitrary timer. Matz Necker @matzzt has a great post on this suggestion: Quick Tip 💡 Embedded Canvas app - Data load problems in OnStart | nckr - blog 🚀

Thanks.  This is a better solution.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,001)