Build text components
To display text on invoices, add text components to cells. Text components display plain text, tokens that display database data, or both, through simple and compound binding. The tokens that are valid for text components depends on which component type the text components are in. For more information, see Tokens.
Text components are elementary components so they cannot contain components.
You can create more than one active version of an invoice template per locale, and use conditional expressions to determine which fields appear on a version of an invoice template. You can only use conditional expressions in templates that you create or that you copy from a marketplace-provided default template. You cannot add conditional expressions to marketplace default templates.
Prerequisitesβ
You can add text components to cell components. See Build cell components.
Default template JSON samplesβ
In the Appdirect Template_EN_US default template, see lines 79-90, 247-259, and 306-316.
To download the default template
π Note: If the AppDirect logo appears in the upper-left corner of the page, when Manage > Marketplace appears in this topic, click the grid icon > Switch to | Store, instead.
- Go to Manage > Marketplace > Settings > Invoice templates > Appdirect Template_EN_US | Gear icon | Download JSON.
Text component JSON schemaβ
{
"type": "text",
"properties": {
"visible" : "true",
},
"style": {
"color": "#333"
"font-size": "12px"
}
"data": "Hello {{First Name}} {{Last Name}}. Your invoice is due on {{Invoice Due Date}}.",
}
Elements to populate text componentsβ
Element | Type | Description | ||
---|---|---|---|---|
text | object | Defines styles, behaviors, and content for text components. | ||
type | string | Required. Defines the component type as text. Valid value: text | ||
properties | object | Required. Define visibility. | ||
visible | boolean | Required. Defines whether component appears on invoices. Valid values: true | false | ||
style | object | Required. Defines formatting for the text. Valid values: HTML element names and CSS styles for the named HTML element. All HTML styles. Only relevant styles that the Invoice Builder can render appear in the user interface preview and the PDF. Examples: "color": "#333" , "font-size": "12pt" | ||
data | string | Required. Text, one or more tokens, or both. Token format: {{Token Name}} Valid values: All text and tokens from a token category that is valid for the component that contains the text component. For example, invoice lines table component or footer. For more information on Tokens, see Tokens. Examples: See the Data property examples section in this topic. |
Data property examplesβ
Examples of how you can combine text and tokens are shown in the following table.
Example type | JSON value | Output |
---|---|---|
Text (simple binding) | Please pay by the due date. | Please pay by the due date. |
Data (simple binding) | {{Invoice Due Date}} | July 1, 2030 |
Text and data (compound binding) | Due date: {{Invoice Due Date}} | Due date: July 1, 2030 |
Was this page helpful?
Tell us moreβ¦
Help us improve our content. Responses are anonymous.
Thanks
We appreciate your feedback!