cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
djallen
Advocate I
Advocate I

OnStart in Embedded Canvas App

Hi,

 

I'm learning Power Apps and working on some test scenarios.  One of which is I have an embedded canvas app that I'd like to enable to work on its own.  That is, I'd like the same app to function while embedded or while running as a standalone app.  The canvas app is a simple app that modifies a record.  

 

To facilitate this I added a screen that would display if the app isn't embedded.  That screen simply asks for user input for the record identifier.  User submits the record identifier and the app will continue as normal.  If the app is embedded in a model-driven form, the record identifier is passed by the parent form and the user input screen should be bypassed.

 

To facilitate this, I set a flag variable "_IsEmbedded" in the app's OnStart action.  

 

If(
    !IsBlank([@ModelDrivenFormIntegration].Item),
    Set(
        _IsEmbedded,
        true
    ),
    Set(
        _IsEmbedded,
        false
    )
);
If(
    _IsEmbedded,
    Navigate(
        HomeScreen,
        ScreenTransition.None
    ),
    Navigate(
        WelcomeScreen,
        ScreenTransition.None
    )
);

If _IsEmbedded = true then navigate to the Home Screen.  If _IsEmbedded = false, navigate to the Welcome Screen where the user is required to enter the record identifier.

 

Unfortunately, this doesn't seem to be working!  When running the app as an embedded app in the model-driven app, the record identifier is successfully passed.  I can display record values.  However, _IsEmbedded remains false.  So, I am always pointed to the Welcome Screen.

 

Am I missing something simple?  Or, is this capability not supported?  

 

Thanks for any help.

 

Regards,

Dan

1 REPLY 1
alrez
Community Support
Community Support

Hi,

 

I've never seen someone try to detect if the app is being ran either when it is embedded or on the web. After talking with some people, we aren't certain that this is possible. This might be a better question to bring to Microsoft Support. I'll include a link below if you would like to go down that route. Otherwise if any other communities members might know or have implemented something like this before feel free to chime in.

 

If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

 

Regards,

 

Alex

 

-------

 

Community Support Team _ Alex Rezac
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,149)