cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rohit4044041
Resolver I
Resolver I

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
Dual Super User

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

10 REPLIES 10
Pstork1
Dual Super User
Dual Super User

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Rohit4044041
Resolver I
Resolver I

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?

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Rohit4044041
Resolver I
Resolver I

@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?

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

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.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

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