Skip to main content

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:

  1. 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.
  2. 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.

Try it without leaving the app

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 nameFirst and last nameJohn Doe
An addressStreet, city, state, zip, country123 Main St, Anytown, CA, 12345, USA
A phone numberArea code and number(555) 123 4567
A phone number with country codeCountry code, area code, number, extension+1 (555) 123 4567 x123
A date rangeStart date and end date01/01/2024 to 12/31/2024
A yes/no answer with an explanationAnswer and explanationYes: 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, and DATE_SIGNED all 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:

PrefixShows up on the form asNotes
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 CodeState is a dropdown of all 50 US states
phone_A single phone number questionExpects something like (123) 456-7890
daterange_A start date and an end date, shown as two date pickersChecks 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 menuFills 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 itemsSee 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.