cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Arioule
Helper III
Helper III

How to determine in which CDS environment a flow (power automate) has been triggered

Hi,

 

I have implemented a flow which is triggered when a CDS record is added (with the current environment option).

I have 2 different environments (Sandbox and Prod) where the solution containing the flow is deployed.

Once triggered the flow calls an azure function using the HTTP action.

I would like to pass as a parameter the CDS runtime environment to my azure function

 

How can I do that ?

 

Thanks

 

Arioule

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for clarifying. Unfortunately there is no way to get that environment from the body nor the headers.

If you have a custom configuration entity, you can use that and have a config record in each environment with the value of the current environment or the desired Azure Function URL. If you don't have a configuration type of entity then you can use the out-of-the-box environment variables.

Then once you have your configuration set up in each environment, in your flow, before calling the Azure function, get the configuration record and then call you function accordingly.

If you end up using environment variables: here's a tip on how to get the value in Power Automate: https://crmtipoftheday.com/1363/get-environment-variables-in-power-automate-and-power-apps/

Hope this helps!

View solution in original post

6 REPLIES 6
AmirBakht
Helper IV
Helper IV

Have you looked into the trigger header to see if you can find something useful there? Just thinking out loud.

EricRegnier
Super User II
Super User II

You can see that by which environment is selected in make.powerapps.com. To see the run history from another environment, select the desired environnment. Cheers

2020-06-17_17-14-06.png

Hi @EricRegnier ,

 

Thanks for your answer.

I may have not been very clear in my question.

I want to pass as a parameter to the azure function called in the flow the CDS environment from where it has been triggered.

Is it possible ?

Thanks for clarifying. Unfortunately there is no way to get that environment from the body nor the headers.

If you have a custom configuration entity, you can use that and have a config record in each environment with the value of the current environment or the desired Azure Function URL. If you don't have a configuration type of entity then you can use the out-of-the-box environment variables.

Then once you have your configuration set up in each environment, in your flow, before calling the Azure function, get the configuration record and then call you function accordingly.

If you end up using environment variables: here's a tip on how to get the value in Power Automate: https://crmtipoftheday.com/1363/get-environment-variables-in-power-automate-and-power-apps/

Hope this helps!

View solution in original post

Thanks a lot @AmirBakht  for your help

Thanks @EricRegnier 

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Users online (83,757)