דלגו לתוכן

Data model

תוכן זה אינו זמין עדיין בשפה שלך.

The Data model sub-tab of the Configuration tab describes the structure of the data that a template is built from. With a data model, a process creates a new template from this template and a set of data. Parts of the form, and recipients, are repeated for each item in a list of the data, for example once for each signer of a loan agreement, and fields get their values from the data.

Building templates from data requires the data model to be included in your organization’s plan. It works with HTML and PDF templates, but not with hybrid templates.

  1. On this sub-tab, you describe the data: its values, and its lists of items.
  2. In the template, you link parts of the form to the data model: pages, sections and rows that are repeated for each item of a list, fields that get their values from the data, and recipients that are repeated for each item. See Use the data model.
  3. In a process, a Web Service element with the BuildTemplateFromData service gets the template and the data, and creates a new template. The process then sends forms of the new template. See The data for building a template.

The data model is a tree of nodes. Each node is a value in the data, or a list of items.

The Data model sub-tab with a String node, an Array node for the signers and its two child nodes

Setting What it is
Id The ID of the node. 2 to 150 characters: letters, digits and underscores, starting with a letter. Two nodes at the same level can’t have the same ID.
Type The kind of value (see the table below).
Source path Where the value comes from in your data, for example contract.signers. You can’t type a path: the list shows only the paths that are already in the data model, such as the paths of an uploaded data model. When a template is built, Cellosign matches the data to the nodes by Id.
Type What it holds
String Text. The type of a new node.
Number A number.
Boolean True or false.
Attachment A file.
Id A value that identifies an item of a list, for example a signer’s ID number. Used to aggregate recipients by id.
Array A list. Its child nodes describe each item of the list.

To build the tree:

  • Click Add Node to add a node at the top level.
  • On an Array node, click Add row to list to add a child node. When you change a node’s type to Array, a first child node is added. When you change an Array node to another type, its child nodes are deleted.
  • To delete a node and its child nodes, click its trash icon.
  • To delete all the nodes, click Clear all. “Are you sure you want to clear all nodes?” is shown: click Yes, clear, or No to keep them.

A node with an ID that isn’t valid shows “Invalid. Required at least 2 alphanumeric characters, start with a letter.”, and an ID that is used twice at the same level shows “Duplicated ID, please provide unique value”. You can’t save the data model until you fix them.

Instead of adding the nodes one by one, you can create them from a JSON file. Click Upload Data Model and select the file. The nodes in the file replace the current nodes.

The file has two lists:

  • initial: values. Each value has an id and a sourcePath (the path as a list of names), and becomes a String node.
  • initial_groups: lists. Each list has an id, a sourcePath and entries, and becomes an Array node. Its child nodes are created from the first item in entries, which has its own initial and initial_groups.

For example:

{
"initial": [
{ "id": "contract_number", "sourcePath": ["contract", "number"] }
],
"initial_groups": [
{
"id": "signers",
"sourcePath": ["contract", "signers"],
"entries": [
{
"initial": [
{ "id": "signer_name", "sourcePath": ["name"] },
{ "id": "signer_email", "sourcePath": ["email"] }
],
"initial_groups": []
}
]
}
]
}

This file creates a String node contract_number with the source path contract.number, and an Array node signers with the source path contract.signers. The signers node has two child nodes, signer_name and signer_email, with the source paths contract.signers.name and contract.signers.email.

  • Every node is created as String or Array. Change the type of the other nodes afterwards, for example to Id.
  • Entries that have no id or no sourcePath are skipped. If the file isn’t valid JSON, nothing changes.
  • The upload changes only the editor. Click Save Data Model to keep the nodes.

The data that the process passes to BuildTemplateFromData has the same format as the uploaded file, with a value for each value, and one entry in entries for each item of a list. The values are matched to the nodes by id. For example, a loan agreement with two signers:

{
"initial": [
{ "id": "contract_number", "value": "TL-2026-0042" }
],
"initial_groups": [
{
"id": "signers",
"entries": [
{
"initial": [
{ "id": "signer_name", "value": "Sample Signer One" },
{ "id": "signer_email", "value": "signer1@example.com" }
],
"initial_groups": []
},
{
"initial": [
{ "id": "signer_name", "value": "Sample Signer Two" },
{ "id": "signer_email", "value": "signer2@example.com" }
],
"initial_groups": []
}
]
}
]
}

The new template has the parts and recipients that repeat for signers twice, once for each entry.

  • initial and initial_groups are required at every level, also when they’re empty.
  • Write each value as text, also for numbers, for example "5000".
  • A value at the top level whose id is the ID of a field of the template fills that field, even when the data model has no node for it.

When a recipient is repeated for each item of a list (see Repeat a recipient for each item), the same person can appear in several items, or in several lists, for example as a borrower and as a guarantor. Turn on Aggregate recipients by id to merge the repeated recipients whose items have the same value in their Id node into one recipient. That recipient fills in the fields of all the merged recipients.

A repeated recipient whose item has no Id node, or an empty value, isn’t merged.

Click Save Data Model to save the nodes and Aggregate recipients by id right away. The template’s Save doesn’t save them, and if you open another sub-tab or tab before you click Save Data Model, your changes are lost.

“Changes are not saved” is shown while you have changes that aren’t saved. Save Data Model is available when there are changes and no errors.

  • In the HTML template editor, pages, sections and rows have Repeat and Repeat Model settings on their Data Model tab, to repeat them for each item of a list. See Repeat a page, section or row.
  • On a field’s Repeater tab, Repeat Model links the field to a node of the data model, which fills the field. See Field settings.
  • On the Workflow sub-tab, Apply repeating model repeats a recipient for each item of a list.
  • A table bound to a list can have a signature column: each item gets a row with its own signature pad, and the recipient of each item signs their own row. See Signatures in a table.

When the template has a data model, the workflow conditions, the process preview and Edit are not shown on the Workflow sub-tab.