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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (77,130)