Route records automatically using custom flow
Omnichannel for Customer Service offers a suite of capabilities that extend the power of Dynamics 365 Customer Service Enterprise to enable organizations to instantly connect and engage with their customers across digital messaging channels. An additional license is required to access Omnichannel for Customer Service. For more information, see the Dynamics 365 Customer Service pricing overview and Dynamics 365 Customer Service pricing plan pages.
Set up custom flow to automatically route records
As an administrator, you can route records automatically using Power Automate. Set up a custom flow to automatically route records based on certain conditions, such as when a record is created or updated. Let's see how to set up a custom flow for the create condition.
Note
By default, for all of the cases created from the user interface, the Route Case field is set to No. So, routing for these cases is not triggered.
For case records, an out-of-the-box trigger is shipped to route the cases automatically. The routing is based on the Route Case field value in the case record.
When a case record is created, it is either routed or not routed based on the Route Case field value of Yes or No.
To enable automatic routing of records:
Sign in to Power Automate and select the environment for which you want to create the flow.
Select My flows on the site map, then select New flow. Under the Build your own from blank option, select Automated cloud flow. The Build an automated cloud flow dialog appears.
Select Skip. A list of all connectors and triggers appears.
Select Microsoft Dataverse. In the corresponding list of triggers that appears, select When a row is added, modified or deleted.
Specify the following values for the Change type, Table name, and Scope fields.
Change type: Create
Table name: Email Messages
Scope: Organization
Select New step. The Choose an operation dialog appears.
Select Perform an unbound action from the Actions list. The Perform an unbound action dialog appears.
Enter msdyn_ApplyRoutingRuleEntityRecord in the Action Name field as a custom value.
In the Target field, select the entity collection name and unique identifier of the record as a parameter as follows.
<entity collection name>(<unique_identifier_of_the_entity>)
, such as emails(<EmailMessage>
)To get the entity collection name for a particular entity:
- Open your browser and go to
https://<org_name>/api/data/v9.0/EntityDefinitions(LogicalName='<entityname>')
. For example:https://contoso.dynamics.com/api/data/v9.0/EntityDefinitions(LogicalName='email')
. - Search for
LogicalCollectionName
to view the entity collection name for a particular entity.
For example:"LogicalCollectionName":"emails"
.
Here,emails
is the entity collection name.
- Open your browser and go to
Select Save.
Now, based on the flow that is defined, whenever a record, in this example, an email, is created, the flow applies the msdyn_ApplyRoutingRuleEntityRecord action to the record. Similarly, you can create a custom flow based on your business scenarios.
You can also perform other actions in the flow, such as filtering out certain records that you don't want to route and performing data transformation.
Related information
Overview of routing
Set up routing for records
Manually route records
Sample code to trigger routing for non-case records