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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,434)