Skip to main content

Use case: Pre-fill from Dynamics 365 records bot + Power Automate connector

Y
Written by Yuliia Biletska
Updated over 2 months ago

Automate data transfers between your MS Dynamics 365 records and documents by combining Power Automate flow with MS Dynamics 365 bots.

In this article, we will describe how to automatically send out pre-filled documents to your recipients by combining a PA flow and the workflow with the Pre-fill from MS Dynamics 365 records bot.

Requirements:

  • WorkFlow account

  • MS Dynamics 365 account

  • Power Automate account

Example: Every time when you have a new customer, you create a new record for them in MS Dynamics 365. After that, you need to send them documents to collect more data for your record. To save time, you want to pre-fill the documents with the basic personal data you already have.

To automate the process, follow the steps below:

Step 1: Create the workflow adding the documents you need to send to the customer.

Step 2: Add and configure the Pre-fill from MS Dynamics 365 records bot.

Step 3: Create the Power Automate flow that will automatically run the workflow every time a new record is created.

Step 1. Create the workflow

Create a new workflow by clicking Start > Design workflow.

Name the workflow and click Add documents to add documents to it.

There are three different options to add a document to your workflow.

  • Upload documents from your device.

  • Import documents from the library, another application, CRM, or storage (pdfFiller, signNow, Dropbox, Google Drive, OneDrive, Box, SharePoint). Click Show more to see more options.

  • Create documents using one of the popular templates.

Learn more about adding documents to a workflow in the dedicated article.

The added document will open in the editor. Start adding fillable fields to your document by dragging them from the side panel.

Tip: When you add fillable fields, it’s more convenient to name each field. This makes it a lot easier to match them with the entity fields later.

Click Continue in the bottom when you’re done with fillable fields.

Now, add execution steps for your workflow and build a diagram with the help of the drag-and-drop interface. Every step is associated with a certain role that you assign to your recipients.

Click the plus icon to add steps and branches. Steps help to configure a hierarchical execution, and branches — execution in parallel.

Name the steps to make your workflow more clear and delete them if needed.

Configure settings for each step by clicking on the gear icon. The settings include the following sections:

  • Assigning certain fillable fields in the document to the step.

  • Assigning recipients to the step from the Address Book or CRM contact.

  • Configuring step execution conditions.

Learn more about designing your workflow in the dedicated article.

Step 2. Add and configure the Pre-fill from MS Dynamics 365 records bot

To add the bot to a step, click the three dots in this step and select Add bot to step.

Search for the bot you need by category or using the search bar. Then, install the bot to your workflow by clicking the Install bot button.

Connection settings

To connect the bot to your MS Dynamics 365 account, click Connect in the Connection settings section.

Then, select the MS Dynamics 365 account you need to connect. You can also connect a new account by clicking Add connection.

Enter your MS Dynamics 365 instance URL. Copy it from your MS Dynamics 365 organization, as shown in the example. After that, click Apply, and you’ll be redirected to the Microsoft login screen. Once you’ve logged in, you’ll be directed back to account.

Once connected, proceed to the next section.

Action settings

In the Select entities and map fields section, indicate the MS Dynamics 365 entity from which the data will be transferred.

Select the MS Dynamics 365 entity from the dropdown.

If you need to retrieve data from a related entity, select it from the base entity menu. Click on the plus icon and select the related entity from the dropdown. Related entities may have different hierarchical levels. To add a new level, click the plus icon near the previous level entity.

Select a data transfer method. Single line method means that you transfer one data instance from field to field, such as Name, Email, and Address, while the table method transfers data from table to table, such as lists of customers or products.

Next, indicate which data must be transferred to the document by mapping the needed entity fields to the respective document fields. Select entity fields and link them to the document fields that should contain the corresponding values from the entity’s record. To map more fields, click the Map another field button and repeat the process.

Note: When you’re pre-filling data from a related entity, you have options to only pre-fill from a related entity or from the entire relation (base entity + related entity(ies)). For the first case, only map the related entity. For the second, map all entities you need to pre-fill from.

Click Continue to proceed with the settings.

You can omit the Select starting record section — the record ID will be transferred by the Power Automate flow action.

Configure Conditions and Advanced settings if needed.

Step 3: Create a Power Automate flow to trigger the workflow

In Power Automate, go to My flows tab. Click +New flows and select Automated cloud flow from the dropdown.


In the pop-up, enter the name of your flow and select the trigger for your flow. In our case, it’s Microsoft Dataverse - When a row is added, modified or deleted. Then, click Create.

On the new page, click on the trigger step to modify its parameters. In the first field, specify the type of the trigger. In our case, it’s Added, because every new record is a new row added to the entity. In the second field, indicate the entity for which the flow will work (in our case, it’s Accounts - the same entity is indicated in the bot’s settings). In the third field, indicate the scope in MS Dynamics 365, for which the flow will work (for example, Organization).

After that, proceed to the action. Click the plus icon under the step and then click Add an action.

Use the search bar to find action quickly and select the Create a new document action from the menu.

In the parameters, indicate the workspace where the workflow you need is located and the workflow itself.

Then, click on the Advanced options field and tick Dynamics Record ID.

Click on the lightning icon to open the dropdown and select Account.

Once ready, click Save.

As a result, every time a new record is created in the MS Dynamics 365 entity, a new document with prefilled data will be generated.

Did this answer your question?