Truncate
Merges a value shortened to a length you set, optionally ending with something to show that text was cut. Use it to keep a review quote, a comment, or a product description from overrunning the space you have for it.
Syntax
{{truncate data length omission}}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Data | Text | Required | The value to shorten. |
| Length | Number | Optional | The total length of the result. Defaults to 50. |
| Omission | Text | Optional | Text added at the cut to show something was removed, such as three periods. Nothing is added when you leave it out. |
Note: The length is the length of the whole result, including the omission. Truncating to 15 with an omission of three periods gives you 12 characters of the value plus the periods, not 15 plus the periods.
Note: A value already shorter than the length is merged exactly as it is, and no omission is added. You will not see trailing periods on something that was never cut.
Examples
The examples below are based on the following sample content:
Feedback received: {{truncate Contact.feedback 15 "..."}}
A. The contact's feedback field is "Great service with fantastic results"
Feedback received: Great servic...
Twelve characters of the value, then the three periods, for a total of 15.
B. The same value, with no omission given
Feedback received: Great service w
C. The contact's feedback field is "Great service"
Feedback received: Great service
The value is only 13 characters, so it is merged whole and nothing is appended.