Create your first flow in Microsoft Power Automate
Learn how to create your first flow in Microsoft Power Automate using the Adobe PDF Services connector.
In this hands-on tutorial learn how to:
- Convert Word documents to PDF
- Combine PDF documents into one PDF
- Protect a PDF document with a password
Preparation
What you need
- Trial or production credentials for Adobe PDF Services
Learn more about how to get and configure credentials in Microsoft Power Automate here. - Microsoft Power Automate with Premium connectors
Learn how to check the level of licensing for Power Automate here. - OneDrive
The OneDrive storage connector is used in this tutorial, but any storage connector can be substituted.
Sample files
There are two sample files that you need to unzip and upload to OneDrive:
- WordDocument01.docx
- WordDocument02.docx
Getting credentials
To complete this tutorial, you need your credentials already configured in Microsoft Power Automate for Adobe PDF Services. If you have not completed this step, see the instructions here.
Part 1: Create new flow and convert Word to PDF
Create the flow
In this part, you create a new flow in Microsoft Power Automate using an instant flow, add parameters, get your files from OneDrive, and convert them to PDF.
-
Navigate to Microsoft Power Automate and log in with your credentials.
-
In the sidebar, select Create.
-
Select Instant Flow.
-
Give your flow a name.
-
Under Choose how to trigger this flow, select Manually trigger a flow.
-
Select Create.
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.
Add parameters to trigger
To have dynamic data pushed into the document, you need to create a few parameters for the trigger to prompt for values.
- When editing your flow, select Manually trigger a flow to expand the action.
- Select Add an input.
- Select Text.
- Name the field First Name.
Repeat steps 2-4 to add the following fields:
- Last Name
- Salary
Get file content of a template
To generate a document, you first need to get the file content of the Word template.
- 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 WordDocument02.docx file in OneDrive.
Generate document from template
- In Power Automate, select + New step.
- Search for Adobe PDF Services in the search bar.
- Select Adobe PDF Services.
- Select the Generate document from Word template action .
- In the Template File Name field, name your file as desired but it must end with .docx.
Merge data
Using the Generate document from Word template action, you can merge data into your document from any of the different variables previously in the flow using Dynamic content.
Copy the JSON data below into the Merge Data field:
{
"FirstName": "",
"LastName": "",
"Salary": ""
}
-
Place your cursor in the field between the two quotation marks for the FirstName value.
-
Using the Dynamic Content panel, insert the First Name value from the Manually trigger a flow action.
-
Repeat steps 7-8 for the LastName and Salary fields.
-
In the Template File Content field, use the Dynamic content panel to insert the File content value from the Get file content step.
Save the file to OneDrive
Once the document is generated, you can save the file back in OneDrive.
- 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 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 the File Name field, set the name of the file. Because the output is a PDF, your file name must end with .pdf extension.
- Use the Dynamic content panel to insert the PDF File Content variable into the File Content field.
Try flow
- Select Save.
- Select Test.
- Select Manually and then Save & Test.
- Select Continue.
- Enter values for First Name, Last Name, and Salary.
- Select Run Flow.
In the OneDrive folder, you now see a PDF generated from the Word document. When you open the PDF document in OneDrive, you see that the data is merged into the text tag locations.
Part 3: Combine PDF into one
Now that you have generated and converted a Word document into a PDF, the next part is to combine multiple PDF documents together.
Add Merge PDF step
- When editing your flow, select + Next step to add an action at the end of your flow.
- Search for Adobe PDF Services in the search bar.
- Select Adobe PDF Services.
- Select the Merge PDFs action.
- In the Merge PDF File Name field, enter your desired file name (i.e.,CombinedDocument.pdf).
- In the File Content -1 field, use the Dynamic content panel to insert the PDF File Content value from the Convert Word to PDF step.
- To add the next document, select + add new item.
- In the File Content - 2 field, use the Dynamic content panel to insert the Output File Content value from the Generate document from Word template step.
Save merged PDF to OneDrive
Once the document is combined, you can save the document back into OneDrive.
-
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 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 the File Name field, set the name of the file. Because the output is a PDF, your file name must end with .pdf.
-
In the File Content field, use Dynamic content panel to insert the PDF File Content value from the Merge PDFs step.
Try flow
- Select Save.
- Select Test.
- Select Manually and then Save & Test.
- Select Continue.
- Enter values for First Name, Last Name, and Salary.
- Select Run Flow.
In the OneDrive folder, you see the combined PDF with pages from the first and second document.
Part 4: Protect PDF document
After generating your document, you can protect it from editing by including an extra step before saving to OneDrive.
Protect PDF
-
While editing your flow in Power Automate, select + in between the Merge PDFs action and the Create file 3 action.
-
Select Add an action.
-
Search for Adobe PDF Services in the search bar.
-
Select Adobe PDF Services.
-
Select the Protect PDF from Viewing action.
-
In the File Name field, set the name to your desired name, as long as it ends with a .pdf extension.
-
Set the Password field to your specified password to open the document.
-
In the File Content field, use the Dynamic Content panel to insert the PDF File Content value from the Merge PDFs step.
Update save to OneDrive
Once the document is protected, you can save the file back in OneDrive. In this example, you are updating the pre-existing Create file 3 action with a new File Content value.
- Select your cursor in the File Content field in the Create file 3 action.
- Use the Dynamic Content panel to insert the PDF File Content value from the Protect PDF from Viewing step.
Try flow
- Select Save.
- Select Test.
- Select Manually and then Save & Test.
- Select Continue.
- Enter values for First Name, Last Name, and Salary.
- Select Run Flow.
In the OneDrive folder, you see the combined PDF that now prompts you to enter a password to view the document.
Next Steps
In this tutorial, you converted a Word document to a PDF, generated a document based on data, merged documents together, and protected with a password. To learn more, explore some of the other actions available in Adobe PDF Services connector in Microsoft Power Automate:
- View the pre-created templates available in Microsoft Power Automate.
- Learn from articles on Adobe Tech Blog.
- Review documentation for Adobe Document Generation API.