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