Hi,
I have a flow set up that connects to CDS using the current environment connector which makes deployment far simpler. This flow ends by sending out a series of email notifications. When the flow is running in the Live environment it needs to send the emails to users (pulled from the CDS records). However, when the flow is running in the development sandbox environment I would like it to send all notifications to a fixed email address.
Is there any way of knowing which environment the flow is in at runtime? If I can get access to this value I can add a switch statement and I won't have to make changes to the flow in each environment.
Proud to be a Flownaut!
Follow me on Twitter at @QG_LeeJHarris
Or on LinkedIn at in/leejharris
Solved! Go to Solution.
Hi @LeeHarris ,
You could store the email addresses in an entity and query the entity for current environment and send notifications
This would help in setting different notif email addresses per envrionment
Also,
when you query CDS using Flow and set envrionment to current example :List records
the response Body does have the environment info
example
{
"@odata.context": "https://unitedstates-002.azure-apim.net/apim/commondataservice/4c0d81ac535a4ee492a4233807abe164/$met...",
"value": [
{
"@odata.id": "https://org0271c79a.crm.dynamics.com/api/data/v9.0/accounts(07dbfaaa-1895-e911-a956-000d3a36eaef)",
You could use Flwo expressions to pull this info out and then accordingly send emails
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
It might just be easiest to add a value to one of the existing entities in both environments or a new entity and save the name of the Environment there. Then you could retrieve it. I'm not aware of any system variables or values that would let you determine the current environment.
Hi @LeeHarris ,
You could store the email addresses in an entity and query the entity for current environment and send notifications
This would help in setting different notif email addresses per envrionment
Also,
when you query CDS using Flow and set envrionment to current example :List records
the response Body does have the environment info
example
{
"@odata.context": "https://unitedstates-002.azure-apim.net/apim/commondataservice/4c0d81ac535a4ee492a4233807abe164/$met...",
"value": [
{
"@odata.id": "https://org0271c79a.crm.dynamics.com/api/data/v9.0/accounts(07dbfaaa-1895-e911-a956-000d3a36eaef)",
You could use Flwo expressions to pull this info out and then accordingly send emails
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @RezaDorrani
Thanks for pointing out the Url in the response body of the List Entity request.
I was able to use the Parse JSON action to extract the @odata.id property and then added a condition to send a different email if the url contained the name of the dev or UAT environment. I should now be able to test without sending any live emails to any users in the system, and deploy to production without the need to edit the Flow process.
Proud to be a Flownaut!
Follow me on Twitter at @QG_LeeJHarris
Or on LinkedIn at in/leejharris
Great !!!
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
85 | |
58 | |
43 | |
38 | |
34 |
User | Count |
---|---|
91 | |
74 | |
73 | |
61 | |
41 |