Create text document from template in Power Automate

This article demonstrates how to generate text documents from a template with the help of the Plumsail Documents feature, which is called Processes, and Power Automate (Microsoft Flow).

This approach is suitable for text files generation as well as for plain text generation. In this article, we will generate a simple text file with the list based on some data. This is how our ready file will look:

Result text file

Here is a step-by-step description of how to create such a process of generating text documents from a template.

Configuring the Process

  1. First, register or login to your Plumsail account.

  2. Click on the Add Process button.

add process button
  1. Give a name to the Process to recognize it later.

create test document from template
  1. Upload the template you want to use. Here is the link for downloading the template used in this particular case.

  2. Once you’ve created the Process and submited the template, you’ll proceed to the next step - Configure template:

  • Fill in the name of the result file;

  • Select HTML format for the output file;

  • Test the template to see how it will look at the end by clicking the Test template button.

create text documents from HTML template

For that, you can copy and paste our sample JSON data:

{
  "departments": [
    {
      "name": "Accounting"
    },
    {
      "name": "IT"
    },
    {
      "name": "Sales"
    }
  ]
}
create txt files from a template
  1. The next step is delivery. For demonstrating purpose, we’ll store the result file in OneDrive. But there are other options:

And others are coming soon.

Select the folder where the ready document will be saved. And fill in its name. Don’t forget to put the extension type .txt.

create TXT from HTML template

You can configure as many deliveries as you need.

  1. The last thing to do is to start the Process. We will start it using Power Automate (Microsoft Flow). You can check out other options.

Creating the Flow

Now we need to create the Power Automate Flow that will start our process of creating text documents from the HTML template and apply data to this template. This is how the complete flow looks:

Create TXT from HTML templates

Here is the step-by-step description of the Flow.

Flow trigger

You can actually pick any trigger. We use “Manually trigger a flow” trigger here to simplify the Flow.

Start document generation process

This is the action from Plumsail Documents connector. This action is suitable for starting the Process of generating documents from a template.

Using the action for the first time, you’ll be asked for ‘’Connection Name’’ and ‘’Access Key’’.

create flow connection

You can type any name for the connection. For example, ‘’Plumsail Documents’’.

Then create an API key in your Plumsail Account page, copy and paste it to ‘’Access Key’’ field.

There are two parameters:

start generation documents action
  • Process name. Select the one process you need among available.

  • Template data. Specify your data in JSON format as we did on the step of testing the template.

That’s it! Run the Flow any time you need to generate text documents from a template.

Note

There is another - a little bit more complicated - way to create text documents from a template. Check the article.