cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dlabar
MVP

How to Provide URL Parameters to Studio

Is there a way to pass Url Paramteres to the Canvas App Studio so the Params() function can access the params?  I have a canvas app that is opened from another canvas app via the Launch function.  When this is called, a recordId is passed via a URL parameter, then when the canvas app is opened, it knows the context via the record id.  This works great when "playing" the app and launching it from one studio to the other, but if I just attempt to edit the app that requires the URL Parameter, I receive an error since the URL is missing.  Is there a way to be able to pass URL Parameters into the Studio Experience?  If not, is there a way in order for the app to know if it's running within the context of the Studio, so I can default the record id?

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Dlabar 

I just finished developing an app that had this very same issue when testing.

 

Is there a way to be able to pass URL Parameters into the Studio Experience?

Not from what I can tell.  After the app opens in Studio mode the URL is redirected to something like this (https://us.create.powerapps.com/studio/#) and it clears any parameters you might try to input 

 

If not, is there a way in order for the app to know if it's running within the context of the Studio, so I can default the record id?

I have an idea for a creative solution here.  When an app opens in Play mode the URL contains a parameter called tenantID.  But when it opens in Studio mode there is no tenantID in the URL.  Therefore we can use the value of tenantID as a check on which mode the app is currently in.

 

To test my idea I suggest you put this code in a new label on the first screen your app opens.  Save & Publish and then try opening the app via Play and via Studio.

If(IsBlank(Param("tenantId")),"Studio Mode","Play Mode")

 

Let me know what you think of this.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@Dlabar 

I just finished developing an app that had this very same issue when testing.

 

Is there a way to be able to pass URL Parameters into the Studio Experience?

Not from what I can tell.  After the app opens in Studio mode the URL is redirected to something like this (https://us.create.powerapps.com/studio/#) and it clears any parameters you might try to input 

 

If not, is there a way in order for the app to know if it's running within the context of the Studio, so I can default the record id?

I have an idea for a creative solution here.  When an app opens in Play mode the URL contains a parameter called tenantID.  But when it opens in Studio mode there is no tenantID in the URL.  Therefore we can use the value of tenantID as a check on which mode the app is currently in.

 

To test my idea I suggest you put this code in a new label on the first screen your app opens.  Save & Publish and then try opening the app via Play and via Studio.

If(IsBlank(Param("tenantId")),"Studio Mode","Play Mode")

 

Let me know what you think of this.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@Dlabar
Did this idea work for you? Please let me know.

Unfortunately, this doesn't work for apps in the PowerApps android app.  I'm thinking I'll use the SaveData/LoadData functions to be able to determine if I'm in a tablet.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn 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.

Top Solution Authors
Top Kudoed Authors
Users online (1,660)