There are two easy options to get the environment name while running an app.
Use an environment variable that you set during deployment
Create a flow that finds the environment name
The first option is easy, just set a text environment variable to the right value and your done. But this is something that needs to be done and could potentially go wrong if you forget to set the environment name.
Create a flow to get the environment name
The flow that we need to create has just 4 steps.
As we will be calling this flow form an app, there will be the Power Apps trigger. You can use either version 1 or version 2.
Display the environment name in your Canvas App in Power Apps 1
Then we will use the List My Environment step. This step will get all the environment details in your tenant.
As there are no filter options on the Get my environment action, we will need to use a Filter Array action to get the current environment.
The above details will take the list of environments and return just the one environment that is recognised by the workflow function as the current environment.
Display the environment name in your Canvas App in Power Apps 2
Then the respond to a Power app action will nbeed the following expression to get the name of the envrionmment:
Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like.
I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide.
For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions.
SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/
Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/
You can contact me using contact@sharepains.com
Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like.
I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide.
For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions.
SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/
Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/
You can contact me using contact@sharepains.com
Properties n’existe pas, c’est directement displayname qu’il faut écrire !
Il faut tester avant d’écrire des anêries …
Did you type .properties.displayName or .properties.displayname?