cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rohit4044041
Helper II
Helper II

Get tenant information within Canvas app

Hello

I thought this will be too simple however, seems to have stuck

We have canvas app that has sharepoint as Datasource. we will be having this app spread across 4 different tenant. I want to show which tentnat currently app is referring to in App header lable. 

I do not want to hardocde this and was thinking to just look at the datasource (Sharepoint) URL and from that recognize which tenant app is running is. I am not able to find any way to get tenant info or Datasource URL

any recomandation please?

NOTE: Cannot use solutions, since that will need additional licensing 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

The easiest way to do this would indeed be to use solutions and environment variables.  What I don't understand is why you say you cannot use solutions since that will need additional licensing.  Solutions on their own are not a premium function.  There is no reason why you can't use them with standard licensed Canvas apps.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Pstork1
Dual Super User III
Dual Super User III

Here's the flow that I call from the Power App to get the Environment.  I actually don't even need to use an Environment variable.  EnvironmentName is the Environment variable I created, but there is also a dynamic content entry for the Current Environment which returns a short name for the current environment without setting an environment variable.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

10 REPLIES 10
Pstork1
Dual Super User III
Dual Super User III

The easiest way to do this would indeed be to use solutions and environment variables.  What I don't understand is why you say you cannot use solutions since that will need additional licensing.  Solutions on their own are not a premium function.  There is no reason why you can't use them with standard licensed Canvas apps.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Rohit4044041
Helper II
Helper II

Thank you @Pstork1 . as i understood, solutions can only be used with plan 1 or 2 ( per user / per app) Are you saying , solutions can be created even with seeded E based power app licenses?

Pstork1
Dual Super User III
Dual Super User III

Plan 1 and Plan 2 don't exist anymore.  Per user and Per app are different.  But yes, I'm saying that solutions themselves can be created even with the "Seeded" Office 365 E licenses.  Solutions themselves don't require a license.

Solutions in Power Apps - Power Apps | Microsoft Docs



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Rohit4044041
Helper II
Helper II

@Pstork1 It seems Canvas app's license designation is converting to premium .

Rohit4044041_0-1623924360275.png

What I did is, 

1. Create Canvas app 

2. Add sharepoint connection.

3. Create New solution

4. Add 2 environment variable.

5. Add exisitng canvas app to this solution

6. Consume environment variable within canvas app.

7. I had to add Env Variable definition and values datasource for consuming variables. 

8. Next time I opened app, it started asking me to start Trial since its Premium app. 

 

I though Solutions/environment varaible can work with standard connection. Do you have any pointer on why app is switching to Premium connection.

 

** Updated: Relaized adding Environment variable values and groups datasource makes it premium. So if not add those datasoruce, how to access environemtn varaibles within canvas app?

Pstork1
Dual Super User III
Dual Super User III

I stand corrected.  The use of a solution doesn't make it premium, nor does the use of an environment variable.  But I hadn't thought about needing the Dataverse tables to read the Environment variable value inside the app.  Its that last part that makes it premium.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

"nor does the use of an environment variable."  How do we use environemnt variable within canvas app without dataverse, any idea?

Pstork1
Dual Super User III
Dual Super User III

That's what I'm saying. Having an Environment variable doesn't require premium.  But Reading the Value of the variable inside your app is what causes the Premium license.  I don't know of any way to do that without incurring the Premium license.  I also don't know any way to directly read the Environment from the settings inside the app.  The only workaround I can think of is to add a variable in OnStart and then manually change that in the app after your import it to a new environment.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Pstork1
Dual Super User III
Dual Super User III

I wanted to let you know that a friend on the Power Apps team just showed me a workaround for this issue.  In Power Automate there is a way to read that environment variable without adding the two Dataverse connectors.  So you can invoke a flow from the app, read the variable and return it as a value to be stored in a variable in the app.  That will not force you into Premium.  I'll work up a sample tomorrow and send you some screenshots of how it works.

 

MS is currently working on this issue.  Its not their intent that this should require Premium.  But in the meantime using Power Automate as a workaround will help.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Pstork1
Dual Super User III
Dual Super User III

Here's the flow that I call from the Power App to get the Environment.  I actually don't even need to use an Environment variable.  EnvironmentName is the Environment variable I created, but there is also a dynamic content entry for the Current Environment which returns a short name for the current environment without setting an environment variable.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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 (4,058)