Templates
A template is the primary version of a document you use often, such as a retainer letter, an offer letter, or an intake agreement. You create it once in Formaliq's built in editor, which works much like Microsoft Word.
A template does two jobs at once:
- It defines the placeholders that need to be filled in. Every placeholder you add can become a question on the form people use to supply that information.
- It defines what the finished document looks like: headings, tables, standard legal language, and any sections that should only appear under certain conditions.
Templates live inside a workspace. You can build one from scratch in the editor, or import an existing Word document to start from.
The Lab (in the sidebar, or formaliq.com/lab)
lets you experiment with placeholders and conditional logic without creating
a real template, form, or workspace. Type a placeholder, fill out the
auto-generated form, and preview the finished document immediately. Nothing
is saved. Click Examples inside the Lab to load a ready-made template for
each pattern on this page, including placeholder prefixes, {{#if}} blocks,
repeating lists, and grouped fields.
Placeholders
A placeholder is a spot in the template that gets filled in with real
information when a document is generated. It looks like this:
{{name_client}}. When a document is generated, Formaliq replaces each
placeholder with the real answer supplied on the form.
Most placeholders hold a single piece of information, such as a name, a date, or a number. Some hold a group of related information, and Formaliq formats it automatically for you:
| This kind of field... | ...is entered as | ...and appears in the document as |
|---|---|---|
| A person's name | First and last name | John Doe |
| An address | Street, city, state, zip, country | 123 Main St, Anytown, CA, 12345, USA |
| A phone number | Area code and number | (555) 123 4567 |
| A phone number with country code | Country code, area code, number, extension | +1 (555) 123 4567 x123 |
| A date range | Start date and end date | 01/01/2024 to 12/31/2024 |
| A yes/no answer with an explanation | Answer and explanation | Yes: Customer has premium membership |
There are also two other kinds of placeholders worth knowing about:
- A group of related fields, such as an address bundled together, so you can insert the whole thing with one placeholder.
- A repeating list, such as a list of invoice line items, which Formaliq can turn into extra rows in a table automatically.
Placeholder Prefixes
Formaliq looks at the name you give a placeholder and uses it to guess what
kind of question to ask on the form. The easiest way to control that guess is
to start the placeholder's name with one of the prefixes below, followed by
an underscore, such as {{date_signed}} or {{phone_client}}.
A few things are true no matter which prefix you use:
- It doesn't matter how you capitalize it.
date_signed,Date_Signed, andDATE_SIGNEDall work exactly the same way. - The prefix stays part of the question's title. Formaliq doesn't remove
it, it just turns underscores into spaces and capitalizes each word. So
{{date_signed}}becomes a question titled "Date Signed," not just "Signed." - The prefix must come before the first underscore in the name. If you
don't use one of the recognized prefixes below, Formaliq falls back to
guessing from the whole name instead (for example, a placeholder simply
called
{{email}}still becomes an email question). When it can't make a good guess at all, it defaults to a plain short-text question, so nothing is ever left out of the form.
Here is what each prefix produces:
| Prefix | Shows up on the form as | Notes |
|---|---|---|
name_ | A person's name, split into First Name and Last Name | |
address_ | A full mailing address, split into Street Address, Street Address Line 2, City, State, and Zip Code | State is a dropdown of all 50 US states |
phone_ | A single phone number question | Expects something like (123) 456-7890 |
daterange_ | A start date and an end date, shown as two date pickers | Checks that the end date isn't before the start date |
date_ | A date picker | |
email_ | A short-answer question that checks for a valid email address | |
number_ | A number question | |
text_ | A short-answer text question | |
textarea_ | A long-answer text question (multiple lines) | |
dropdown_ | A dropdown menu | Fills in state, country, or status choices automatically if that word appears in the name; otherwise you set the choices yourself |
radio_ | A multiple-choice question (pick one) | |
checkbox_ | A multiple-choice question (pick any that apply) | |
toggle_ | A yes/no switch | |
boolean_ | A yes/no switch | |
rating_ | A star or number rating | |
slider_ | A slider for picking a number in a range | |
list_ | A repeating group of questions, for things like line items | See Forms |
There's one field type without a matching prefix: a phone number with a
country code and extension ({{phone_}} alone only gets you a plain phone
number). To get that richer phone question, add the field from the question
type picker in the form builder instead of relying on the placeholder name.
If you skip the prefix entirely, Formaliq still recognizes a handful of
common whole names and treats them the same special way, including name,
firstName, lastName, fullName, company, address, street,
streetAddress, city, state (dropdown), zip, zipCode, postalCode,
email, phone, phoneNumber, date, startDate, endDate,
birthDate, amount, price, cost, salary, age, quantity,
description, notes, comments, title, position, and department.
Beyond that list, Formaliq takes its best guess based on words it recognizes
anywhere in the name. A placeholder called {{shippingAmount}} still
becomes a number question because it contains "amount," {{customerState}}
becomes a dropdown because it contains "state," and {{orderItems}}
becomes a repeating list because it contains "items." When in doubt, using
one of the prefixes above is the most reliable way to get exactly the
question type you want.
Sections that appear or disappear
A template can also include content that only shows up when it should, for example a paragraph that appears only for clients in a certain state, or a table row that only appears if a line item was actually entered. This is called conditional logic, and it is explained in full, with plain language examples, on the Conditional Logic page.
Next steps
- Conditional Logic: learn how sections, tables, and sentences can appear or disappear automatically.
- Use Cases: see complete, worked examples for common documents like letters, invoices, and contracts.
- The Lab: try any of the patterns above live, with instant field detection and a document preview.