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.

Prerequisites

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.

Software

  • 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

Licenses

  1. 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:

    1. Go to the Power Automate portal, navigate to My Flows > Desktop flows.
    2. 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:

    1. 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
  2. Get a trial license for the Dynamics 365 for Customer Service app.

Set up your device

Now that prerequisites are set, you are on your way to get the free solutions that automate your processes.

Get the latest updates for your environment

  1. Go to Power Platform admin center, select the environment in which you're interested, and then select Dynamics 365 apps.

    Screenshot of the Dynamics 365 apps option in the Power Platform admin center.

  2. Confirm that the Agent Productivity Tools and App profile manager are updated.

    Screenshot of the Agent Productivity Tools and App profile manager options.

  3. If you see Update available for Agent Productivity Tools and App profile manager, select Update available.

Install and configure Power Automate

  1. 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.

  2. Switch the Power Automate machine settings to the environment in which you'll install the solution.

    Screenshot of the Power Automate machine runtime application.

  3. Sign in to the Power Automate portal to create a cloud flow with manual trigger.

    Screenshot of the Build an instant cloud flow dialog.

  4. Add the appropriate action to run desktop flows.

    Screenshot of the Run a flow built with Power Automate for desktop action.

  5. Select Directly to machine from the list.

  6. 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.

    Screenshot of the connect option in Run a flow built with Power Automate for desktop action.

Install and configure Contoso CRM app

  1. Download the Contoso CRM app package on the machine where the automation runs.

  2. 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.

    Screenshot of the Windows protected your PC dialog.

  3. When the installation is complete, run the Contoso CRM app from the Windows Start menu.

    Screenshot of the Contoso application.

Install the Dynamics 365 RPA solution

  1. Download the automation solution and save it on your machine.

  2. Import the Dynamics 365 automation solution in the environment of your choice:

    1. Go to https://powerautomate.microsoft.com and sign in using your work account.
    2. Select the environment in which you wish to work.
    3. In the vertical menu on the left of your screen, select Solutions.
    4. In the main bar, select Import then Browse.
    5. Navigate to the solution file you previously downloaded and double-click on it.
    6. Select Next.
  3. Configure the connections needed to be used by the solution in the environment:

    1. 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.

    2. For the Desktop connection domain/username and password, ensure you use the machine's Windows credentials.

    Screenshot of the connections that need to be configured to be used by the solution.

  4. Go back to the tab in which you initiate the above step and select Refresh.

  5. Select Import. The solution explorer shows you a message informing you that the solution is being imported. This step may take a few minutes.

  6. 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.

  7. From the Dynamics 365 Customer Service app, sign in to Power Automate.

    1. From the case you're working on, select the menu > Flow.

    Screenshot of the Flow option in the Dynamics 365 Customer Service app.

  8. Select Login to Flow.

  9. Authenticate using your Dynamics 365 account.

  10. Now open one of your cases using Shift + Left Click to launch the productivity tools panel.

    Screenshot of the productivity tools panel.

  11. 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.

  12. 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.

    Screenshot of a demo showing the automation.

Customize the automation solution

  1. 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.

  2. 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.

  3. 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.

    Screenshot of the Solution tab in the Power Automate portal.

  4. 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.

  5. 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.

  6. 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).

Troubleshooting and known issues

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.