Parallels with Excel
If you are familiar with Excel, this page will help you understand DocuMold by highlighting the similarities and differences between them.
High level view of Excel
A cell in Excel can contain 3 things:
- Simple content
- Data
- Excel formulas
The difference between simple content and data can be subtle.
- The simple content is there to be read by someone. Either to help use/interpret the spreadsheet, or to develop said spreadsheet. An example of simple content: the title of a column.
- The data is there to be used by formulas or to be interpreted by someone. The values in columns and intermediary calculation steps are examples of data.
Formulas use the data to calculate what their cell should display. The result is usually more data, but sometimes it’s only simple content.
High level view of DocuMold
A DocuMold template can contain 2 things:
- Simple content
- DocuMold commands
While an Excel document contains the data needed by its formulas, a DocuMold template doesn’t. Instead, you provide the data through a web form when generating a document from your DocuMold template.
DocuMold then uses that data to execute the commands of the template. This results in a new document that you can use. It contains:
- Simple content
- The result of the commands using the provided the data
Referring to data
In Excel, you refer to data by its position in the spreadsheet, ex: D11
and D11:D17
.
In DocuMold, you refer to your data by the names you give it, which DocuMold calls variables. You can
use any name as long as it starts with a lowercase letter and only contains letters, numbers and
underscore (_
), ex: client_name2
and totalPrice
.
When using a template to generate a document, DocuMold searches the template to find the variables and asks you to provide a value for each of them.
Excel’s formulas and DocuMold’s commands
In Excel, formulas can only set the displayed content of the cells.
In DocuMold, commands can do more things:
- Write a value in the document (that’s what Excel’s formulas do)
- Remove content from the document. Using
@IF
and@ENDIF
, you can remove entire sections based on a condition. - Configure the web form used to ask data when using the template to generate a document.
- Set the name of the generated document
In Excel, formulas must be alone in their cell. Formulas start with an equal sign (=
).
In DocuMold, commands can be anywhere in the document (ex: in the middle of a paragraph), so they
need indicators both before and after. DocuMold commands start with <#
and end with #>
.
Here is an example of a DocuMold command:
This is a contract between <# UPPER(client_name) #> and ...
Data types
In both Excel and DocuMold, you can use these basic data types:
- Text:
"Some text"
- Number:
123
and-5.6
- Date
- Boolean:
TRUE
andFALSE
Excel has ranges of cells, which contain distinct values.
DocuMold has lists, which contain distinct values. They can also be written in command directly,
here is a list containing numbers: [1, 1, 2, 3, 5]
, the spaces are optional.
Excel has array formulas, which apply a formula to many distinct cells and display the result in multiple cells.
DocuMold has list calculations, which apply a calculation (functions and operators) to each entry in a list and returns a new list.