web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to setup dynamic v...
Power Automate
Answered

How to setup dynamic variables in Flow triggers that require environment specific values

(0) ShareShare
ReportReport
Posted on by 222

Hi all.

 

I have been working with Power Platform for a little more than a year. I work for a bigger corporation where Power Platform is not officially OK'd, but our region has received some special exemptions and are allowed to work in and develop automations, apps etc. Within certain boundaries. This also means that we do not currently have access to setup Pipelines for deployment and testing, and must do the majority manually or through Visual Code.

 

We are currently struggling a little bit with the best practice for some of our Solutions.

I have a DEV Environment, Test environment and a PROD environment, so the Solutions should go from DEV -> Test -> PROD, but I am finding it difficult to figure out how best to accomplish this with Triggers that require Environment specific variables.

 

As an example, we are using Dataflows to create Databases and backends for some of our automations and apps, and we have specific flows triggering when the dataflows are updated. However, I have to hardcode the Environment as well as the Dataflow in my Trigger

Gematria_0-1696502684396.png

 

I have tried using workflow() outputs to determine the environment, but that made the trigger fail constantly.

 

I would prefer to be able to deploy a complete solution with everything related to that specific process (Dataflows, Tables, Apps, Flows etc.) and not have to go into the Test or PROD environment afterwards and manually update the Managed flows.

 

I have considered simply changing the Solutions manually through PowerShell or similarly before importing into the new environment, but that also seems like an annoyance and would require us to import the Dataflows and Tables separately so the IDs of the individual entities are created in the other environment(s).

 

Is there a solution to this that is easy to maintain and setup?

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,963 Moderator on at

    Hi @Gematria 

     

    I would use Environment Variables. But please note that you still have to add them as part of a solution (or manually) and you will still need to "set" the values in the environment. There are different ways, one being manual and what alot do. So you wont get away from manually updating

     

    But you can also create a configuration page that triggers on install of the solution and then you type in / select what you want, but that requires custom work too

     

    But I would still use Environment Variables, which the Flow can see in the Dynamic window and will be able to pick them up in the other environments as long as they exist already or were part of the solution that installed the flows.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Gematria Profile Picture
    222 on at

    Hi.

     

    Thanks for the assistance, I will look into using the Environment Variables instead.

     

    Should I set the Environment Variables in the PROD environment or in the DEV environment included in the Solutions I deploy or what would be the best approach?

     

    I'm guessing it would be easiest to define the Variable values in the PROD environment?

  • Michael E. Gernaey Profile Picture
    53,963 Moderator on at

    Hi @Gematria 

     

    You would define them in whatever environment you would first test or dev them. Then as you export your managed solution to install into the other environment, it will be created.

     

    I'd be grateful if you could mark my answer as Resolved and possibly a thumbs up.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 463

#1
Valantis Profile Picture

Valantis 463

#3
11manish Profile Picture

11manish 264

Last 30 days Overall leaderboard