Create Excel document from template

If you’re looking to save time on routine tasks by auto-generating purchase orders, this article will guide you through the process. We’ll provide a step-by-step approach to creating an Excel document from an XLSX template using Processes, a Plumsail Documents tool for document generation.

Processes provide a user-friendly, intuitive interface for creating documents from templates, converting and delivering them to different systems for further management.

In this article, we will generate a purchase order from a template, and this is how the final document will look:

Generated purchase order from an XLSX template

Let’s go through the following steps and create a process for generating Excel documents from a template:

Configure Process

First, log in or create your Plumsail account.

Create new process

We’ll use a pre-built XLSX template for this example. You can download an XLSX purchase order template.

Click Add Process and select Upload a document.

Add Process menu with the Upload a document option

Set the Process name and click Create.

Add Process menu with the Upload a document option

If you prefer to create the template yourself, click Add Process, select Start from blank.

Add Process menu with the Start from blank option

Next, select XLSX as the template type and enter a Process name.

Select XLSX as the template type

Configure template

Once you’ve created the process, proceed to Configure Template.

Template configuration includes two sections:

  • Editor

  • Settings

You can modify the uploaded template directly in the Editor.

Edit online an XLSX template in the Plumsail Documents process

You can also use Document Sets to add several templates to the same process. See the Document Sets documentation for more information.

Templating syntax

When designing your own template from scratch, start by reviewing the templating language used in Plumsail Documents. Plumsail Excel templates use a different approach compared to other templating solutions, utilizing minimal syntax to get the job done.

For more information about the XLSX templating engine, see how XLSX templates work.

Essentially, the templating engine interprets everything between the curly {{ }} brackets as a variable, dynamically applying your specified data. In our case, the simplest tokens would be {{orderDate}} and {{orderNumber}}. They let the engine know that we want to render the purchase order number and its date.

However, we can also implement more complex scenarios. In our template, we reference properties within a collection of products using nested tokens with a dot operator:

  • The {{product.name}}, {{product.quantity}}, {{product.price}}, {{product.cost}} tokens retrieve the name, quantity, price and cost properties of a product.

The templating engine is smart enough to identify which content needs to be duplicated. It iterates through all objects in the array, rendering each one and automatically adding the necessary rows.

You can learn more about repeating rows and table rendering.

The advantage of using an Excel template is the ability to add formulas. We’ll use the following formulas to calculate the total cost for each item individually and for all items combined:

  • =[Quantity]*[Unit Price] - for each item

  • =SUM(D14) - for all the items

Test template

To check how the final document will look, click Test template.

Test an XLSX template with sample data

A dialog window will pop up where you can fill in the auto-generated testing form. Form fields are created based on the tokens from your document template. You can adjust the look of the testing form by changing token types.

Test an XLSX template with sample data

Enter sample data, then click Test & Preview to generate and inspect the document.

Once the template is ready and you’re satisfied with the results, Save the process.

Switch the process to Production mode to remove Plumsail watermarks from resulting documents.

Switch the process to Production mode

Go to the Template settings:

  • Enter an Output filename. You can add tokens to personalize the Output filename. They function the same way as they do in the template. For example, by adding {{orderNumber}} token, the generated purchase order will be named Purchase order 432.

  • Select XLSX format for the output file type.

Configure settings for an XLSX template process

Add Delivery

Proceed to Delivery settings. In our example, we’ll store the generated purchase orders in OneDrive, but there are many other options, such as Dropbox, DocuSign, SharePoint, email, and more.

First, you will be prompted to connect your OneDrive account to Plumsail. Then, create a folder where the generated purchase orders will be saved. Tokens can be used here as well.

You can add as many deliveries as needed.

Store the generated XLSX document in OneDrive

Start Process

Everything is now ready for you to begin generating Excel documents from an XLSX template. Click Run process to choose how to trigger document generation.

Start options for an XLSX document generation process

See how to choose a trigger to run the process for more information.

Hint

Use Power Automate Flow, Zapier and Make to integrate the Documents Process with other apps. This allows you to collect data from one application and pass it into the process to populate an Excel (XLSX) template and generate a document. You can use data from various web forms, CRM systems, SharePoint lists, and thousands of other web applications to complete your XLSX template.