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?
Solved! Go to Solution.
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.
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.
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.
Has anyone noticed that when running the Toggle.OnChange "hack" the even it raised twice when canvas app is actually embedded in Dynamics.
I can repro this as a setup counter to increment every time OnChange is called. On the first load, it's always raised twice. If manually toggle the counter only increments by 1.
That solution works!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
23 | |
5 | |
4 | |
4 | |
3 |
User | Count |
---|---|
25 | |
11 | |
10 | |
8 | |
8 |