Data and Variables
Variables give templates their superpowers. They tell Documint where to place your data in your document.
Last updated
Variables give templates their superpowers. They tell Documint where to place your data in your document.
Last updated
Variables are what Documint uses to make templates dynamic. They are used to tell Documint where in your template to place your data, when to repeat/loop page elements over lists in your data, and to conditionally show or hide page elements based on the values in your data.
In addition to telling Documint where to place your data, there are also functions that you can use to manipulate data in your template. Here are some of the things you can do using functions:
format numbers, percentages, currencies, dates, and durations
filter a list of data
join data from a list
create custom variable
group data together
properly display markdown text
etc.
To add a variable to your template click the ‘New Variable button’ on the right-hand Data pane, enter the name of your variable in the input field, copy the generated variable name then paste the variable into a text field.
Don't include spaces or any special characters in your variable names
When your template contains variables it’s important to test those variables with sample data to see what your documents will look like before you connect your template to a data source. Enter test values to the variable fields and click 'Save & refresh'
If this is the first time you are using 'Preview' you will see a blank version of your template in the Preview Pane as we do below.