Make texts dynamic via a script
To personalize texts, for example, send a letter that looks basically the same as an invoice to many recipients with the respective other data, this is easier to do with dynamic texts (see birthday greetings).
To make texts dynamic using a script, you have 2 options:
Connect simple strings and fields with the plus operator +
.
Template strings with values inside braces {...}
.
Concatenate simple strings with the +
operator. Use +
to include any data type, e.g., numbers.
At least one of the data types must be a string, so that the output is also a string.
In a table, create a First Name field and paste the following content into a formula field.
Result: Hello Sam! (if the First name field contains the value Sam)
Template strings are indicated by a 3 minus signs ---
at the beginning and end. Everything in between turns into text.
Put braces {...}
around scripts, e.g., to write a serial letter that fetches the relevant data, such as first and last name, address, etc., from a table.
Same as above, but with a template string.
Result: Hello Sam! (if the First name field contains the value Sam)