Skip to main content

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.

note

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.

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

ElementTypeDescription
textobjectDefines styles, behaviors, and content for text components.
typestringRequired. Defines the component type as text.
Valid value: text
propertiesobjectRequired. Define visibility.
visiblebooleanRequired. Defines whether component appears on invoices. Valid values: true | false
styleobjectRequired. 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"
datastringRequired. 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 typeJSON valueOutput
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?