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:
Here is a step-by-step description of how to create such a process of generating text documents from a template.
First, register or login to your Plumsail account.
Click on the Add Process button.
Give a name to the Process to recognize it later.
Upload the template you want to use. Here is the link for downloading the template used in this particular case.
Once you’ve created the Process and submitted 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.
For that, you can copy and paste our sample JSON data:
{
"departments": [
{
"name": "Accounting"
},
{
"name": "IT"
},
{
"name": "Sales"
}
]
}
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
.
You can configure as many deliveries as you need.
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.
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:
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’’.
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:
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.