Get file contents of files
Next, get the file contents of the sample files.
-
In Power Automate, select + New step.
-
Search for OneDrive in the search bar.
-
Choose either your work or personal OneDrive account by selecting OneDrive for Business or OneDrive.
-
Search for Get file content in the search bar.
-
In the File field, select the Folder icon to navigate to the WordDocument01.docx file in OneDrive.
Convert file to PDF
Now that you have the file content, you can convert the document to PDF.
-
In Power Automate, select + New step.
-
Search for Adobe PDF Services in the search bar.
-
Select Adobe PDF Services.
-
Search for Convert Word to PDF in the search bar.
-
In File Name, name your file as desired but it must end with .docx. This extension is necessary for converting documents from Word to PDF.
-
Place your cursor in the File Content field.
-
Using the Dynamic content panel, select File content.
Save the file to OneDrive
Once the document generates, save the file back in OneDrive.
- In Microsoft Power Automate, select + New step.
- Search for OneDrive in the search bar.
- Choose either your work or personal OneDrive account by selecting OneDrive for Business or OneDrive.
- Search for Get file content in the search bar.
- Search for Create file in the search bar.
- Select Create file.
- In the Folder Path field, select the folder icon to specify where to save the file in OneDrive.
- In File Name, name your file as desired but it must end with .docx. This extension is necessary for converting documents from Word to PDF.
- In the File Content field, use Dynamic content panel to insert the PDF File Content variable.
Try flow
- In the top-left, select Untitled to rename the flow.
- Select Save.
- Select Test.
- Select Manually and then Save & Test.
- Select Continue.
- Select Run Flow.
In the OneDrive folder, you should now see the converted PDF.
Part 2: Generate a dynamic document from a template
This next part builds on Part 1 and uses the Generate document from Word template to dynamically merge data into your document.
Review the document template
Open WordDocument02_.docx from your sample files in OneDrive. The Word document contains several different text tags that represent places where data is populated into the document.