Excel DOCX templates in Plumsail Documents use a different approach than most other templating solutions. It uses a minimal amount of syntax to make your work done. Let us start with basics and move to more advanced scenarios.
First of all, pick how you will apply templates:
Create a process and start it using Power Automate (Microsoft Flow), Web form or REST API
Let us assume we have some simple data object that we want to apply to our template.
JSON representation of the object:
{
"name": "Mark Nigma"
}
And we want to include the name in the generated document. We need to surround the property with braces. The template is on the left side, the result is on the right side:
You can easily display collections of items in Excel document. You don’t need to declare any loops, the templating engine is smart enough to understand the structure of source object applied to your document. Thus, if you refer property of object inside a collection, it understands that we need to iterate it.
Let us assume we have information about customer names. JSON representation of the object:
[
{
"firstName": "Efren",
"lastName": "Gaskill"
}, {
"firstName": "Sanly",
"lastName": "Keyme"
}, {
"firstName": "Mark",
"lastName": "Nigma"
}
]
The template on the left side will result in the document on the right side:
The same approach as above works for tables: