Generate PDF Attachments in Dynamics 365 Using Microsoft Flow
When we need to generate a PDF in Microsoft Dynamics 365, for example, a quote or invoice, we generally have two choices:
1. Either, automate it using a third-party add-on
2. Or, manually convert to PDF using a word template
But, we have another easy solution that helps us to generate PDF attachments. Microsoft Flow helps us to get the work done without coding by following the below steps.
1. Add an on-demand workflow that runs on a quote and generates a word document.
2. Develop a flow that fires of the creation of a note record and does the PDF conversion and attaches the note record back against the original record.
I will explain these using an example, say a quote and a quote summary.
On-demand workflow to generate a word document
Using the standard out of the box functionality, add an on-demand workflow. Dynamics 365 also has an out of the box action which we can make use of. Here we use the action ‘SetWordTemplate’
We have to add the action ‘SetWordTemplate’
In properties, select the template.
This workflow will be available on demand and when we run this, a docx quote summary will be generated as an attachment in the quote.
Create a Flow for PDF conversions
We have to create a flow that is triggered by the creation of a note record. We also have to check if the regarding is quote and has document attachment. The whole steps to create a flow is given below.
Conclusion
Though there are a lot of out-of-the-box functionalities in Dynamics 365 that benefit our requirements, some functionalities like saving/converting a word document to PDF manually remains outside the box. Microsoft Flow comes as an ideal solution in this context.
Hi Muhammed, I am not able to correctly run the function “convert file (preview)” on flows. Looks like the function is no longer available; do you know something more?
HI Fabio
It’s not the issue with convert to pdf, I guess. You need to use the base64ToBinary function when creating the file in OneDrive.
A reply with the image is sent to your mail id. Thank you for reading our blog.