Use RPA with Dynamics 365 Customer Service
Dynamics 365 empowers your organization to deliver operational excellence and delight every customer. To make your use of Dynamics 365 even more productive and save users time and errors, we're releasing free automation solutions that let Dynamics 365 customers automate common tasks.
This article outlines the steps you need to automate end of cycle reporting in Dynamics 365 Customer Service and focus on higher-priority activities that require your unique creativity.
Before starting, you must prepare your environment with adequate licenses and software setup. This section provides step-by-step instructions about how to get the grounds ready.
Install Dynamics 365 for Customer Service.
Install Power Automate. Power Automate will carry out the steps in Dynamics 365 as if a human were doing it in front of their computer.
The Contoso CRM app from Microsoft. This app showcases how RPA works. You can use it as an example to build your own RPA action.
Important
Ensure you get the appropriate security roles for the account that runs your automation. This account can be a dedicated one created by your admin in Microsoft Entra or an employee's account.
Use the following recommended security roles:
Application | Security role | Link to documentation |
---|---|---|
Power Platform | Option 1: Environment admin Option 2: Environment maker (if the environment already has Dataverse and unattended license needed) |
|
Dynamics 365 for Customer Service | D365 Customer Service administrator | Enable users for Customer Service and assign roles |
Get a trial license for Power Automate, if you don't have a paid license. The license you need depends on the mode in which your automations run.
Power Automate support two modes to automate processes.
Attended mode: someone is sitting in front of their computer and watching the process run as if they were doing it manually. To run attended, users need to acquire the Power Automate per-user license with RPA.
Unattended mode: the process runs in the background on remote machines that users don’t see. To run unattended, users need to have acquired two licenses: Power Automate per-user license with RPA and the Power Automate unattended add-on.
To get a trial license for Power Automate per-user license with RPA:
- Go to the Power Automate portal, navigate to My Flows > Desktop flows.
- Select Start free trial now
Alternatively, launch Power Automate for desktop and select Start trial on the console on the Premium features dialog.
To add a trial license for Power Automate unattended add-on:
- As an admin, you can get an RPA unattended add-on and assign it to your environment. To find more information about the RPA unattended add-on, go to Power Automate sign-up Q&A in your organization
Get a trial license for the Dynamics 365 for Customer Service app.
Now that prerequisites are set, you are on your way to get the free solutions that automate your processes.
Go to Power Platform admin center, select the environment in which you're interested, and then select Dynamics 365 apps.
Confirm that the Agent Productivity Tools and App profile manager are updated.
If you see Update available for Agent Productivity Tools and App profile manager, select Update available.
Download and install Power Automate on the machine that will run the automation. You can find more information about Power Automate installation in Install Power Automate.
Switch the Power Automate machine settings to the environment in which you'll install the solution.
Sign in to the Power Automate portal to create a cloud flow with manual trigger.
Add the appropriate action to run desktop flows.
Select Directly to machine from the list.
Select Directly to machine in the Connect field. Then, select the machine name on which you've installed Power Automate, and enter the machine credential (the username and password you use to sign in to the machine. To find more information about direct connectivity, see Manage machines.
Download the Contoso CRM app package on the machine where the automation runs.
Run setup.exe from the extracted package.
The Contoso app shows you how the end-to-end automation scenario works so that you can follow the example to create your own automation.
Select More info > Run anyway on the Windows protected you PC screen that appears during the installation.
When the installation is complete, run the Contoso CRM app from the Windows Start menu.
Download the automation solution and save it on your machine.
Import the Dynamics 365 automation solution in the environment of your choice:
- Go to https://powerautomate.microsoft.com and sign in using your work account.
- Select the environment in which you wish to work.
- In the vertical menu on the left of your screen, select Solutions.
- In the main bar, select Import then Browse.
- Navigate to the solution file you previously downloaded and double-click on it.
- Select Next.
Configure the connections needed to be used by the solution in the environment:
For each connector the solution uses, either select an existing connection or create a new one using your Microsoft account and credentials of your choice.
For the Desktop connection domain/username and password, ensure you use the machine's Windows credentials.
Go back to the tab in which you initiate the above step and select Refresh.
Select Import. The solution explorer shows you a message informing you that the solution is being imported. This step may take a few minutes.
Open Case entity session – default template (or your current case entity session template), open Agent scripts tab, and then add Case agent script with automation. To find more information about session templates, go to Manage session templates.
From the Dynamics 365 Customer Service app, sign in to Power Automate.
- From the case you're working on, select the … menu > Flow.
Select Login to Flow.
Authenticate using your Dynamics 365 account.
Now open one of your cases using Shift + Left Click to launch the productivity tools panel.
From the Agent Script session in the productivity panel, you can see several agent script steps. The first step is Run Automation to validate Customer. Select the Run button and confirm it runs.
The automation starts on the machine where you have installed Power Automate. You can watch how the automation uses the case data, opens the Contoso CRM app, and then finishes the lookup automatically. After the automation runs, refresh the timeline to view the logs regarding the run result. Here's a demo on how it runs.
Now, you can start customizing the automation to meet your unique requirements. To do this, open Power Automate and select Edit on the Legacy Contoso App Contact Lookup desktop flow. You can save a copy to work on your customizations or work on the template directly.
Notice that there are multiple child flows. Each child flow uses the keyboard or the mouse to interact with the Contoso CRM app. You need to update the steps to interact with your legacy app.
After testing the desktop flow, you can save it. Now, open the cloud flow in
https://powerautomate.microsoft.com/manage/solutions
from within the solution tab -> Customer Service RPA solution.Open the cloud flow named Automation to validate customer info and expand each action to review. In the Desktop flow action, you can switch to use any desktop flow and input/output parameters. To find more information about triggering desktop flows from cloud flows, go to Trigger desktop flows from cloud flows.
Save the cloud flow. Go back to Dynamics 365 portal and trigger the agent script action to test. You'll see your customization automation running.
Once you finished testing, you can share the cloud flow with everyone in the organization with run-only mode and switch it to run in unattended mode. This way every agent will be able to reuse the same automation. License wise, the cloud flow should be put under a Power Automate Process plan (previously Power Automate per flow).
Known issue | Workaround |
---|---|
Can't see the productivity tools panel in the Dynamics 365 customer service. | Productivity tools aren't available on the home session. You need to create a new session (Shift-click on case link) to see it. Productivity tools runtime initialization is async, so wait 1 – 2 seconds on home session before creating new sessions. |
Agent can’t see the flow | At the first time, every agent needs to sign in to the flow from the Dynamics 365 widget. |
During installation, users get prompted multiple times to confirm the installation. | Confirm with yes I am sure to install every time prompted |
The agent script isn’t added to the current session template automatically after importing the demo solution. | Add manually the agent script to the case session template. |