After you upload your .csv data you will get a list of tags that can be used within the .docx template. The easiest way to use them is to just click (copy) icon next to the tag you want to use.
To make sure tags will be properly recognized all the .csv headers are by default transformed to lower case and all the spaces are replaced with underscore character.
For premium user, the Custom Title option is available. This allows users to provided a custom title for their final file.
For creating a custom title you could use the following format You Text
followed by the data object (which is ignored in the output) i.e. { data }
, your place tags
A complete example Welcome Letter { data } - { last_name
There are times you need to show different content based on the provided data. That's where conditional content shines.
For example: if in your template you need to differentiate gender and you have gender
field in your .csv data then you can do it as below:
{#gender == 'female'}
It's for her.{/}
The basic formula looks basically like this:
{#your_tag_here == 'Whatever it should be equal to'}
Some content you want to show if your_tag_here is equal to your condition.{/}
You can also do it with numbers like this:
{#speed > 100}
That was fast!#{/}
In case you want to put if/else statement:
{#isGood == true}
So good#{'{/}'}{^isGood}
Not so good...{/}
^
is used if the first expression is not true)Things to keep in mind:
{/}
at the end that encloses the content to showPro tip: use different tag colors for improved readability:
{#gender == 'female'}
It's for her.{/}{#gender == 'male'}
It's for him.{/}
Tags for conditional content are replaced so colors don't impact content within them.
Filters are a great way to augment your data on the fly! Let's say you need all the first names lower cased. To do that you would need to add tag to your tag like this:
{first_name | lower}
You can also chain filters together like this:
{first_name | lower | upperCaseFirstLetter}
Keep in mind that filters are applied in the order you put them!
Thanks to this without any additional work all the names will be all lower case.
If you need additional filters feel free to reach out and we will add it!
Available filters:
Filter names | Description |
---|---|
lower | all characters to lower case |
upper | all characters to upper case |
upperCaseFirstLetter | first character to upper case |
Available filters for numbers:
Filter names | Description |
---|---|
add:X | add X to number |
subtract:X | subtract X from number |
multiply:X | multiply number by X |
divide:X | divide number by X |
toWords | transform numbers into words (i.e. 120 into "one hundred twenty") |
If there is a filter missing that you want reach out to us!
Generate documents based on provided .csv data and .docx template.
https://doctempleapp.com/api/generate
(please sign in)
Header parameters
Name | Type | Description |
---|---|---|
X-Doctemple-Api-Key | String | API key required to have access |
Form-data parameters
Name | Type | Description |
---|---|---|
template | String or File | URL to the template .docx file or upload File directly |
sourceData | String or File | URL to the .csv file or upload File directly. Csv file required with headers. |
outboundWebhook (optional) | String | Endpoint that will receive the download link |
titleFormat (optional) | String | Title format (see docs for reference) |
dropPrefix (optional) | Boolean | Title format (see docs for reference) |
convertToPdf (optional) | Boolean | Convert generated documents to .pdf. If there are more than 15 rows in the .csv file it defaults to false |
Example response
{
"downloadLink": "https://storage.googleapis.com/templater-d1fb0.appspot.com/1611258132-3c03b5832a810493a075d2ebd6759b3df5e9a74b.zip"
}
All the download links and files get expired and deleted after 3 days.
Response fields
Name | Type | Description |
---|---|---|
downloadLink | String | Direct link to the file. It's name is uniquely created by timestamp and 20 random character hash so your files are safe. |