top of page
  • Writer's pictureYash Agarwal

Generate Documents with Microsoft Syntex and Power Automate

In this #PowerShot, I will show you how to create a template using Microsoft Syntex Content Assembly and use that template with Power Automate to create documents on the fly. We will use Content Assembly capabilities in Microsoft Syntex to automatically generate standard repetitive business documents.


You can review detailed documentation about Content Assembly in Microsoft Syntex here.


As a pre-requisite, you will have to setup Microsoft Syntex and the steps for it can be found here.


Let's Get Started

As an example, we will create a setup to generate an offer letter for a contractor. A business user, will be able to input all the relevant information in a manually triggered Power Automate flow that will generate the document using the template created with Microsoft Syntex.


Create a Template with Microsoft Syntex Content Assembly

Step 1: Create a word document with a sample offer letter. In the sample document, you can use text place holders that can later be selected to replace with fields while creating the template.

Step 2: Create a new document library. This is an optional step, you can also use an existing document library.

Step 3: Navigate to the document library and click on +New. From the dropdown, select "Create modern template" as shown in the screenshot below:

Step 4: Upon selecting the option to create the modern template, a popup appears where you can either select an existing file from the SharePoint Document libraries on the site or upload one from your device. You can click on Browse this device to select a file as shown in the screenshot below.

Step 5: Once the file is uploaded, you will be able to start configuring fields on the template as shown in the screenshot below.

Step 6: Select the data from the document that you want to replace and add the field as shown in the screenshot below. You can either select the option for the field to replace the selected data or just add it as a form field.

Step 7: Upon clicking next from the previous step, you can now configure the data definition. For this example, we will directly select the data type for the field. The data type selection options are as shown in the screenshot below.

Step 8: Repeat the same step as above for all the other data inputs. For any data input that needs to be added at multiple places, you can just select the text and then select the data definition. Below is a screenshot of the page with all the data definition mappings.

Step 9: To use the template, it needs to be published. Click on the publish button as shown in the screenshot below to publish the template.

Step 10: Upon selecting publish, you can also add the data definitions as columns in the document library. You can also select specific columns to be added or no columns in case the data is already being referred to from a list or library.

Step 11: Once published, you can start creating a template by clicking the +New button and then the template in the document library as shown in the screenshot below.

Step 12: Once you click the template to start creating a document, a form loads up and as the data is populated in the form, the fields replace data as shown in the screenshot below.

Step 13: Once all data is populated, upon clicking the Create Document button, you can provide a name for the document and create it.

Step 14: Once the document is created, all the metadata is populated in the columns as shown in the screenshot below.

Power Automate

Step 1: Flow trigger: Manual - As the flow will be manually triggered, we will use the Manual Trigger for triggering the flow on demand. Below are the inputs configured on this flow that the user will provide in order to generate the offer letter. Select the manual type trigger and configure the inputs as shown in the screenshot below.

  1. Contractor Name: Text

  2. Contractor Email: Text

  3. Contractor Address: Text

  4. Contractor Role: Text

  5. Contract Start Date: Date

  6. Contract End Date: Date

  7. Hourly Rate ($): Number

  8. Supervisor (name and email): Text

  9. Place of Work: Choice

  10. Recipients of Offer Letter: Email

Step 2: Action: Generate Document using Microsoft Syntex (Preview)

Using this action, select the Site, Document Library and the Template. You will see the list of data definitions that you can map from the dynamic content selector based on the trigger configuration. Once all the data mappings are complete, provide the file name, path to save the file. Below is a screenshot of the action configured with all the inputs.

Step 3: The output of the above action is a word document and can be converted to a PDF using the OneDrive convert action. The flow can be further built to integrate Approvals and set document status to further automate the process.

 
Setup in Action
 

In this post, we saw how you can create a template using Microsoft Syntex Content Assembly and use it to automatically generate documents with Power Automate. The process can further be simplified by using Power Apps and other data sources to pre-populate existing data rather than using Power Automate to fill up the data each time.


I hope you found this interesting and it helped you. Thank you for reading!


Recent Posts

See All
bottom of page