I see lots of questions regarding the best way to connect to a dynamics environment with Power Automate and people who struggle to find functionality that should be offered but not sure where to look. It’s not clear as crystal that there are two available CDS Connectors in Power Automate and what differs the two.
The Deprecated One
Let’s just start this post by making it very clear that the Dynamics 365 Connector in Power Automate is deprecated. Yep. I see blog post every other day still utilizing this. It has not been updated in a looong time nor will it be around for much longer – so please make sure your existing flows are not using this and that all your new flows absolutely does not use it.
The Two CDS Connectors
As you might have noticed there are two CDS Connectors, one called Common Data Service (current environment), released in june 2019, and one just plain Common Data Service. For the simplicity of it let’s call them Current Environment Connector (right) and Old CDS Connector (left) in this post.
1. Solution dependent
The Current Environment Connector is ONLY available if you create your flow in a solution. Note the I use the word create. This means that you can’t take an excising flow and move it into a solution to make those actions and trigger available.
2. Triggers different on Events
Current Environment can trigger on several events in a single flow, while the old CDS Connector only trigger one event per flow.
Current Environment can trigger on several events in a single flow while the old CDS Connector only triggers on one event per flow. This makes the Current Environment far superior when it comes to build efficient flows.
Current Environment Connector
Only have one trigger but with the possibility to select several events as as trigger condition.
Old CDS Connector
Need to create and maintain several flows even though you want the same thing to happen no matter if it’s a create or an update for example.
3. On-Demand Trigger
In the Old CDS Connector there is a trigger available that the Current Environment Connector doesn’t have: When a record i selected. This trigger let’s the user select one or several records and manually trigger a flow. A very useful feature, especially if you are replacing your old on-demand workflows!
Another thing worth knowing about this trigger is that it doesn’t deploy well. Only flows with this trigger that are NOT in a solution will be available from the Flow button in your CDS Environment. You can read Jerry Weinstocks blogpost about it here.
4. Environment choice
In the Old CDS Connector you have to choose what environment every trigger and action should run in/on. In the Current environment Connector you have no choice like this, it automatically runs in the environment the solution exists in.
5. Populate Lookup behavior
Old CDS Connector
Using the Old CDS Connector to populate a Lookup in a record is easy peasy. You just use the dynamic data and tadaaaa: DONE.
Current Environment Connector
Using the Current Environment Connector for populating lookups is unfortunately not as easy. You need to define your entity schema name in plural and then input your dynamic content value in parentheses. Not claiming it’s particularly difficult but it definitely takes some extra time when composing your flow.
6. List Records
Both connectors have an action called List Records. The Current Environment Connector offers to filter your records using FetchXML which is a huuuuuuge benefit in my book. So huge it deserved it’s own blog post: Retrieve Records in N:N relationships with FetchXML and the New CDS Connector in Microsoft Flow.
Kidding. It actually deserved two blog posts: How to Avoid the “Get Record” Action to Retrieve Related Data in Power Automate.
7. Actions available
In the Current Environment Connector there are several actions available that doesn’t exist in the Old CDS Connector.
7a. Child Flows
Calling and creating Child Flows are only available with the Current Environment Connector and only works if created from a solution. A great benefit with this feature compared to the one available in the classic workflow engine is that both parent and child can use input from each other when run.
In my image for example I’ve asked for two things in my child flow that I need to define in my parent.
A downside compared to workflow though is that a child flow is only a child flow. It can not have another trigger for example on an update of a record like a child workflow could.
7b. Relate and Unrelate Records
Read more about this feature in Emma D’arcys blog post here.
7c. Perform a bound/unbound action
This feature is the same feature available in the classic workflow engine where you needed to call an action for example when you wanted to close a case, close an opportunity or send an e-mail.
7d. Execute a changeset request
Quite a new feature. Scott Durow wrote an excellent blog post about this when it was released that I recommend you read. Still quite immature when it comes to functionallity, it has several limitations like:
- Only three available actions in the change set
- Not possible to use dynamic data from previous actions within the changeset (Thanks Antti Pajunen for that information)
- Not possible to copy+paste nor drag and drop actions in to a changeset
I expect this feature to evolve in the feature but for now it’s good to be aware of the limitations.
7e. Image and Files actions
Just in the last couple of days several actions regarding the new field types Image and File has appeared in Power Automate. If you want to know what these field types offer a CDS implementation I’d recommend you reading Jukkas blog post about it here. This might be a game changer for many scenarios where we’ve had issues in the past!
If you have flows that only contain trigger and actions using the Current Environment Connector your flows will be deployed as On, and therefore not need any manual effort after a deployment. This is a big win for this connector! I would recommend you reading my blog post about this though as it might look like you still need that manual layer even if you don’t: Deploy Your CDS Flows Without Updating the Connection.
9. Copy Environment
Do you ever use the function to copy an environment that is available in the PPAC (Power Platform Admin Center)? This is great for example when creating a temporary test environment with production data to test a new feature. Or like in my case: when I do live demo sessions or training where I want to save time and not set up same environment, data and configuration several times. This is a warning to all of you who uses this feature.
Copy an environment that contain flows that uses the Current Environment Connector will cause your triggers in the copied environment to complain about duplicates and will not run.
To make it a tad easier to congest I’ve tried to summarize the difference in a table. This list makes it pretty obvious that despite a few backwards steps with lookups and the on-demand trigger there is really only one trigger to focus on in the future: The Current Environment Connector. If you haven’t started using it, I recommend you exploring it at once and refactor your existing flows to not use the Old CDS Connector anymore.
|CURRENT ENVIRONMENT||OLD CDS CONNECTOR|
|Only available from Solutions||–|
|Trigger on several events||Trigger on one event|
|Solution aware||Choose Environment|
|Non-user friendly way to populate Lookups||Only need Dynamic Content to populate Lookups|
|List Records with FetchXML||–|
|Can list records in N:N relationship||–|
|Can run child flows||–|
|Can execute (process) actions||–|
|Can execute change sets||–|
|Image and file actions|
|Deploys without manual layer after||Needs unmanaged layer after deploy|
|Doesn’t work in “Copied” Environment|
What would Yoda have said about the Current Environment Connector?
The Force is strong with this one!Yoda
Excellent post! Thanks for the great summary and specially the hint on lookups. Did you report the “Copy environment” issue? Would say the “When a record is selected” trigger should get a current environment version soon. Thx again
Yes the product team knows about the cope environment issue.
Regarding the on-demand trigger – I would certainly hope so! The ALM process of these types of flows are unsustainable so I hope 2020 will be the year for several improvments 🙂
Great post Sara, thanks a lot.
One more thing I experienced with the new current environment CDS connector: It’s not possible to set a lookup value with “Accounts/Account(Value)” as you showed above when the dynamic value is null.
I’ve not yet found a way to set a lookup value to null. 😦
Are yoj also fit when it comes to connect Power BI via CDS to Dynamics 365 BC?
Hi Andreas! Unfortunately Dynamics 365 BC is not my strong suit, so can’t advice on that 🙂
Hi Sara. No problem. See you in Barcelona.
Thanks Sara. Love the way you’re writing!
David Yack mentioned that by April 2020 release the Copy Environment topic shouldn’t be an issue anymore:
Also I recognized that for entity lookups you need the EntitySetName (from here: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/entities/account) instead of “only plural”. In fact in most cases it is the same. For the create record action I’m using “products/Product” or “pricelevels/Price List (Value)” or “msdyn_workorders/Work Order (Value)” or “uoms/Unit”.
Thank you for the feedback! That is awesome, I’ll update mypost when I find time with your finding about the entitiysetname 🙂
I’ve read the same release notes as David, I hope that it is so – but it doesn’t mention the Current environment connector per say – so let’st just say I’ll not get my hopes up until I see it 😉
I started read your page after the Saturday 365 in London. You have been helped me a lot with your Blog, so many issues that I could solve that is hard to find in one place.
My last issue using the Commom Data Service Connector was populate the Multi-Select field. Do you know something about it? Isn’t it possible yet?
Thank you a million
Thank you, Sara, I’m a newbie to Power Platform (but not to Dynamics), and every time I feel like I’m drowning, I find a lifesaving post like this one! You wrote this post about 9 months ago, I’d love to find out if anything (besides what’t noted in the replies) has changed – hopefully for the better – since you posted this.
Seems as my reply have disappeared.
I’m glad you found my blog helpful!
A few things have changed since I posted it.
When a record is selected trigger still only excist in CDS (old connector), but that connector is now available in solutions so you can create solutions with proper ALM and that trigger.
Deployment is also getting better, you can read more here: https://flow.microsoft.com/en-us/blog/move-flows-across-environments-without-resetting-connections/
Most other things are as before though.