Convert Word to PDF file using Microsoft Flow in Dynamics 365

Introduction

In this blog, we will convert Word to PDF file using Microsoft Flow in Dynamics 365 and then store that converted file on OneDrive. After that, we will attach that file back to the CRM record and delete the Word file from CRM. 

Learn more about our Dynamics 365 CRM services

Microsoft Flow is a cloud-based service that makes it facile for line-of-business users to build workflows that automate time-consuming business tasks and processes across applications and services. Utilizing Microsoft Flow, you can connect your Cognito Forms to many different services, including OneDrive, Outlook 365, Dropbox, Gmail, and more.

Flow

Connects two packages (ex, Cognito Forms, and Google Drive).

Trigger

A trigger is an event that starts and invokes a flow. For instance, if you want to create a new subscriber in MailChimp, every time a brand-new form is submitted, the new form entry becomes the Trigger. Cognito Forms triggers consist of:

  • Update Entry: Triggers when someone updates a record (i.e., access submitted while the status isn’t incomplete).
  • New Entry: Triggers while someone creates a new entry.

Action

An Action is the event that performs a flow. Cognito Forms triggers include:

  • Create Entry: Create a new form entry.

Condition

Specify that a flow performs one or more duties simplest if a specific circumstance is true.

Boost your productivity in Dynamics 365 CRM with Microsoft Flow.

Are you ready to seamlessly streamline your workflow by converting Word documents to PDFs? Discover how with AlphaBOLD. Let's revolutionize your document processing today.

Request a Demo
  • Step 1: Log in to Microsoft Flow, and you will see the screen below after logging in.
  • Step 2: Go to My Flows > click on New > click Create from blank as shown below.
  • Step 3: After that, we will select the trigger we want to use in this scenario. We will use “When a record is created,” as highlighted in the image below.
  • Step 4: Now, we will select the “Organization Name” and the “Entity Name” we want to utilize. In our scenario, we are using Notes.
  • Step 5: Now, you will see the below screen. Click on “New step” to add a condition.
  • Step 6: Now we will select the “ConditionFileName, equal to the File we want to convert, as shown in the image below.
  • Step 7: Now, we will create an action to connect with OneDrive for Business, as shown in the image below.
  • Step 8: Now, we will select Action from OneDrive for Business, which we want to utilize in our scenario. It will be “Create file”. You can see this in the below image.
  • Step 9: After that, we will fill in the required fields that are either selected or we will utilize the function “base64ToBinary” (base64ToBinary(triggerBody()? [‘documentbody])) to get the body of the reference file and create a clone on OneDrive as shown in the above image.
    Detail related to base64ToBinary.
    Return binary version for a base64-encoded string.

Parameter

String Type that is the base64-encoded string to convert and its Required.

Return value

String Type that is a binary version of the base64-encoded string.

  • Step 10: Now, we will add another action to convert the file and provide the desired “File.” Give the ID and Target type as PDF, as seen on the screen below.
  • Step 11: We will add another Action to Create a new record. Within that, we will create a Notes entity record and provide the document content from the previous action, highlighted below.

Read more: Dynamics 365 Integration with Twilio using Microsoft Flow

  • Step 12: Now we will add another Action to Delete file. It will delete the file from OneDrive, but to do that, we will need to provide the File with ID from the previous step in which we created the file, as highlighted in the below screen.
  • Step 13: Now we will add another Action to Delete a record. We will delete a Notes entity record that contains the docx file that we recently created. To do this, we must provide an item identifier with the records we need to delete, as highlighted on the screen below.

Now, we will add the docx file to an account record.

Once the Flow gets triggered, it will convert the docx file to a PDF one, as shown in the image below.

Now, we log in to the flow and check the Run History of it.

Read more: Create Records using Microsoft Flow in Dynamics 365

So, we have successfully converted the docx file to the pdf with the help of Microsoft Flow as the connector between Dynamics 365, and we have also learned how to attach it to the record.

If you have any questions or queries, please contact us

Innovate with Smart Document Solutions

Explore the potential of Dynamics 365 CRM with smart document solutions. From Word to PDF, automate and innovate with AlphaBOLD. Ready to enhance your document workflow and business efficiency?

Request a Demo

Explore Recent Blog Posts

Infographics show the 2021 MSUS Partner Award winner

Related Posts

Receive Updates on Youtube

2 thoughts on “Convert Word to PDF file using Microsoft Flow in Dynamics 365”

  1. Hi there! This Flow template provides a no code solution to a development gap I’ve been facing! I have followed your instructions to build a Flow in my environment. When I test, the Flow succeeds through Step 9 (it creates the file in OneDrive), and then fails (does not convert the file to PDF). Error includes “status = 406, message = bad request, source = api.connectcorp.svc.ms.” Any ideas?

  2. Hi @Sarah Compter,

    Thank you for getting in touch with us. Unfortunately, it’s Microsoft connector issue as it is mentioned in the error, so you need to create a ticket with Microsoft Helpdesk. Please let us know if you need any assistance.

    Regards,
    BOLDEnthusiasts

Comments are closed.