Skip to main content

Export module

📖 Description​

The Export module contains helper functions for exporting data from form instances. When you run a Tripetto form, all the data that is collected by the form is stored inside the form instance. When you want to retrieve the collected data, you need one of the functions in this module to do so.

tip

The most common used function for data extraction is exportables which retrieves all exportable data from the form. Exportable data is all the data marked by the form creator as exportable. This is the response data that should be saved in most cases.

ℹī¸ Exportable vs. actionable data​

Tripetto supports two types of data collections that are retrieved from a form:

  • Exportable data: These are all the fields in the form that are marked as exportable by the form creator;
  • Actionable data: These fields are generated by action blocks that can perform certain actions like sending an email message.

The exportable data is the most important data collection as it includes all the fields that usually need to be stored. Form creators have the ability to specify if a block should be included in the data export or not. By default, most blocks are. There is a special function called exportables to make it easy to retrieve those data fields. So, a common setup would be to retrieve this data collection and then submit it to an endpoint as this is the response data that should be saved in most cases.

The actionable data, on the other hand, is volatile data required for performing actions when the form completes. It often needs to be transferred to an API or endpoint to allow further processing. One of the most common actions is post-processing the Mailer block. This block allows form creators to compose email messages in the form. It is a powerful feature, but it needs additional work to get it up and running properly.

tip

Please have a look at the Post-processing actions guide for more information about actionable data and how to process it.

📇 Functions overview​

The following table shows the available data export functions and a description of what they do:

FunctionDescription
exportablesExports all exportable fields (fields in the form that are marked as exportable by the form creator). This is the de facto function for retrieving response data from a form.
exportablesWithDataExports all exportable fields that actually contain data.
exportablesDiffExports all exportable fields whose value has been changed.
datasetExports all fields to a dataset object.
typedDatasetExports all fields to a statically typed recursive dataset object.
NVPsExports all exportable fields as name-value pairs.
CSVExports all exportable fields in CSV format.
CSVWithDataExports all exportable fields that actually contain data in CSV format.
CSVDiffExports all exportable fields whose value has been changed in CSV format.
actionablesExports all actionables fields.
valuesExports all raw data values from the form.
fields🗑ī¸Exports all exportable fields (deprecated, use exportables instead).

👩‍đŸ’ģ Example​

import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
// This exports all exportable data in the form
const exportables = Export.exportables(instance);

// Iterate through all the fields
exportables.fields.forEach((field) => {
// Output each field name and value to the console
console.log(`${field.name}: ${field.string}`);
});
}
});

â–ļī¸ Functions​


🔧 actionables​

Retrieves all actionable fields. These fields are generated by action blocks that can perform certain actions like sending an email message.

tip

More information about actionable data can be found in the Post-processing actions guide. To implement validation of the actionable fields read the Validating response data guide.

Signature​
actionables(instanceOrContext: Instance | Context): IActionables | undefined
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
Return value​

Returns an IActionables object with the actionable fields or undefined if there is no actionable data in the supplied instance or context.

info

There is a JSON Schema available for the IActionables object (handy for static validation). You can download it here.


🔧 CSV​

Retrieves the exportables fields in CSV format.

Signature​
CSV(
instanceOrContext: Instance | Context,
selection?: string[],
separator?: string,
delimiter?: string
): ICSV
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included (see exportables for more information).
separatorstringYesSpecifies the string that is used to separate subject and field names for slots that are part of an iteration (default is /, see exportables for more information).
delimiterstringYesSpecifies the delimiter for the CSV output (default is ,).
Return value​

Returns an ICSV object with the CSV fields header and data record.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
// Retrieve the CSV output
const csv = Export.CSV(instance);

// Output CSV to the console
console.log(csv.fields);
console.log(csv.record);
}
});

🔧 CSVDiff​

Retrieves all exportable fields that have changed during the lifecycle of the form in CSV format. It is identical to the CSV function, with the only difference that it only includes the fields that are changed. This is useful, for example, when a form is prefilled with data and you are only interested in the fields that have been changed by the form respondent.

Signature​
CSVDiff(
instanceOrContext: Instance | Context,
selection?: string[],
separator?: string,
delimiter?: string
): ICSV
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included (see exportables for more information).
separatorstringYesSpecifies the string that is used to separate subject and field names for slots that are part of an iteration (default is /, see exportables for more information).
delimiterstringYesSpecifies the delimiter for the CSV output (default is ,).
Return value​

Returns an ICSV object with the CSV fields header and data record.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
// Retrieve the CSV output
const csv = Export.CSVDiff(instance);

// Output CSV to the console
console.log(csv.fields);
console.log(csv.record);
}
});

🔧 CSVWithData​

Retrieves all exportable fields that have a value set (and therefore contain data) in CSV format. It is identical to the CSV function, with the only difference that it only includes fields that contain data (fields that are filled in by the form respondent).

Signature​
CSVWithData(
instanceOrContext: Instance | Context,
selection?: string[],
separator?: string,
delimiter?: string
): ICSV
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included (see exportables for more information).
separatorstringYesSpecifies the string that is used to separate subject and field names for slots that are part of an iteration (default is /, see exportables for more information).
delimiterstringYesSpecifies the delimiter for the CSV output (default is ,).
Return value​

Returns an ICSV object with the CSV fields header and data record.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
// Retrieve the CSV output
const csv = Export.CSVWithData(instance);

// Output CSV to the console
console.log(csv.fields);
console.log(csv.record);
}
});

🔧 dataset​

Exports all fields as a dataset object. A dataset is a flat list of all the fields of a form, where the name (or alias) of each field is used as key. When a field is part of a section or subform that has an alias set, that alias is used to prefix the key of the field. Multiple aliases are separated using the supplied separator.

caution

When there are fields with duplicate keys (for example, fields that have the same alias set), then the names of consecutive fields are suffixed (for example, Field name (2)).

Signature​
dataset(
instanceOrContext: Instance | Context,
separator?: string,
escape?: boolean
): IDataset
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
separatorstringYesSpecifies the string that is used to separate multiple field names and aliases (default is /).
escapebooleanYesSpecifies if the field names needs to be escaped to prevent the use of the separator in the field names. Escaping is only possible when a single-character separator is used and works by prepending the character with a backslash (default is true).
Return value​

Returns an IDataset object with the fields.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
const dataset = Export.dataset(instance);

// Let's assume the form has a text block with alias `name`
// Now we can access the value for that block in the dataset
console.log(dataset.name.value);
}
});

🔧 exportables​

Retrieves an IExportables object with all exportable fields. These are all the fields in the form that are marked as exportable by the form creator. Tripetto uses a slot system to store data. Each block in a form generates one or more slots, and these slots are then filled with values as the respondent fills out the form. This function exports all data slots regardless of whether a value is set for a particular slot or not. If you only want to retrieve the slots that have a value set, use the exportablesWithData function.

If you want, you can filter the desired fields by entering the slot identifiers of the fields you want to export in the selection argument. The separator argument is there to separate field names and is useful for slots that are part of an iteration. Tripetto allows the use of iterations to ask the same set of questions multiple times for multiple subjects. The field names of those fields will then be prepended with the name of the current subject in the iteration (also known as the context of a field). This prevents multiple values with the same value name in the data set. The subject and field name is separated with the specified separator string (that defaults to /).

tip

To implement validation of the exportable fields read the Validating response data guide.

Signature​
exportables(
instanceOrContext: Instance | Context,
selection?: string[],
separator?: string,
escape?: boolean
): IExportables
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included.
separatorstringYesSpecifies the string that is used to separate subject and field names for slots that are part of an iteration (default is /).
escapebooleanYesSpecifies if the field names needs to be escaped to prevent the use of the separator in the field names. Escaping is only possible when a single-character separator is used and works by prepending the character with a backslash (default is false).
Return value​

Returns an IExportables object with the exportable fields.

info

There is a JSON Schema available for the IExportables object (handy for static validation). You can download it here.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
const exportables = Export.exportables(instance);

// Iterate through all the fields
exportables.fields.forEach((field) => {
// Output each field name and value to the console
console.log(`${field.name}: ${field.string}`);
});
}
});

🔧 exportablesDiff​

Retrieves an IExportables object containing all exportable fields that have changed during the lifecycle of the form. It is identical to the exportables function, with the only difference that it only includes the fields that are changed. This is useful, for example, when a form is prefilled with data and you are only interested in the fields that have been changed by the form respondent.

Signature​
exportablesDiff(
instanceOrContext: Instance | Context,
selection?: string[],
separator?: string,
escape?: boolean
): IExportables
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included (see exportables for more information).
separatorstringYesSpecifies the string that is used to separate subject and field names for slots that are part of an iteration (default is /, see exportables for more information).
escapebooleanYesSpecifies if the field names needs to be escaped to prevent the use of the separator in the field names. Escaping is only possible when a single-character separator is used and works by prepending the character with a backslash (default is false).
Return value​

Returns an IExportables object with the exportable fields.

info

There is a JSON Schema available for the IExportables object (handy for static validation). You can download it here.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
const exportables = Export.exportablesDiff(instance);

// Iterate through all the fields that contain data
exportables.fields.forEach((field) => {
// Output each field name and value to the console
console.log(`${field.name}: ${field.string}`);
});
}
});

🔧 exportablesWithData​

Retrieves an IExportables object containing all exportable fields that have a value set and therefore contain data. It is identical to the exportables function, with the only difference that it only includes fields that contain data (fields that are filled in by the form respondent).

Signature​
exportablesWithData(
instanceOrContext: Instance | Context,
selection?: string[],
separator?: string,
escape?: boolean
): IExportables
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included (see exportables for more information).
separatorstringYesSpecifies the string that is used to separate subject and field names for slots that are part of an iteration (default is /, see exportables for more information).
escapebooleanYesSpecifies if the field names needs to be escaped to prevent the use of the separator in the field names. Escaping is only possible when a single-character separator is used and works by prepending the character with a backslash (default is false).
Return value​

Returns an IExportables object with the exportable fields.

info

There is a JSON Schema available for the IExportables object (handy for static validation). You can download it here.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
const exportables = Export.exportablesWithData(instance);

// Iterate through all the fields that contain data
exportables.fields.forEach((field) => {
// Output each field name and value to the console
console.log(`${field.name}: ${field.string}`);
});
}
});

🔧 fields 🗑ī¸â€‹

danger

This function is deprecated and here for legacy purposes. Please use the exportables function instead.

Retrieves an IExportables object with all exportable fields. These are all the fields in the form that are marked as exportable by the form creator. Tripetto uses a slot system to store data. Each block in a form generates one or more slots, and these slots are then filled with values as the respondent fills out the form. This function exports all data slots regardless of whether a value is set for a particular slot or not.

Signature​
fields(
instanceOrContext: Instance | Context,
selection?: string[],
separator: string,
escape?: boolean
): IExportables
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included.
separatorstringYesSpecifies the string that is used to separate subject and field names for slots that are part of an iteration (default is /).
escapebooleanYesSpecifies if the field names needs to be escaped to prevent the use of the separator in the field names. Escaping is only possible when a single-character separator is used and works by prepending the character with a backslash (default is false).
Return value​

Returns an IExportables object with the exportable fields.

info

There is a JSON Schema available for the IExportables object (handy for static validation). You can download it here.


🔧 NVPs​

Export the exportable fields as name-value pairs. If the modifier argument is omitted, the type of the values is either string, boolean, number or undefined. If modifier is set to strings all values will cast to a string value. So then the value type is always string. You can also supply a custom modifier function that receives an IExportableField object for each field as input and should return one of the supported primitive types as output.

Signature​
NVPs(
input: Instance | Context | IExportables,
modifier?: "strings" | (field: IExportableField) => string | boolean | number | undefined
): {
[name: string]: string | boolean | number | undefined;
}
Parameters​
NameTypeOptionalDescription
inputInstance | Context | IExportablesNoReference to the instance, context or an exportables object.
modifier"strings" | (field: IExportableField) => string | boolean | number | undefinedYesSpecifies a modifier for the value of each pair. It can be one of the following values:
- strings: Will cast each value to a string;
- Custom modifier function: Receives an IExportableField object for each field as input and should return one of the supported primitive types as output.
Return value​

Returns an object with name-value pairs.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
// Retrieve the name-value pairs
const values = Export.NVPs(instance);

// Output the values to the console
console.dir(values);

// Or use a custom modifier
const custom = Export.NVPs(instance, (field) => `has value '${field.string}'`);
}
});
tip

There is only one version of the NVPs function and there are no separate functions for retrieving the NVPs of all exportable fields with data (exportablesWithData) or the changed fields (exportablesDiff). Instead the NVPs function accepts the output of one of the exportables functions as input. So you can do this:

// Retrieve name-value pairs for all fields that contain data
const fieldsWithData = Export.NVPs(Export.exportablesWithData(instance));

// Retrieve name-value pairs for all fields that have been changed
const changedData = Export.NVPs(Export.exportablesDiff(instance));

🔧 typedDataset​

Exports all fields to a statically typed recursive dataset object.

info

This function is generic and allows to specify the type of dataset you are expecting from your form. Since this is a loose binding, you should always verify that a field actually exists in the returned dataset. To force this, the function automatically marks all properties in the returned object as optional. You can use optional chaining to easily check if a value is present or not.

caution

When there are fields with duplicate keys (for example, fields that have the same alias set), then the names of consecutive fields are suffixed (for example, Field name (2)).

Signature​
typedDataset<T extends ITypedDataset>(
instanceOrContext: Instance | Context,
): T
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
Return value​

Returns an ITypedDataset derived object with the fields.

info

All the properties in the returned dataset object are marked as optional and readonly.

Example​
import { run } from "@tripetto/runner-autoscroll";
import { Export } from "@tripetto/runner";

run({
definition: /* Supply your form definition here */,
onSubmit: (instance) => {
// Let's assume we have a form that has a text block with alias `name`, and
// a subform with alias `order` that has a number block with alias `amount` and `total`.
const dataset = Export.typedDataset<{
name: Export.IExportableField;
order: {
amount: Export.IExportableField;

// You can also pick the properties you need from `IExportableField`:
total: {
value: number;
}
}
}>(instance);

// We can use optional chaining to assure we have a valid value.
console.log(dataset.order?.amount?.value || "Oh noes!");

// Or drilldown with if statements
if (dataset.order?.total) {
console.log(dataset.order.total.value);
}
}
});

🔧 values​

Retrieves a collection of all valid values. The values are stored per slot. The key of each value object is the identifier of the slot.

Signature​
values(instanceOrContext: Instance | Context, selection?: string[]): IValues
Parameters​
NameTypeOptionalDescription
instanceOrContextInstance | ContextNoReference to the instance or context.
selectionstring[]YesSpecifies the identifiers of the slots that should be included.
Return value​

Returns an IValues object with the values.

caution

Only use the values function if you have good reason for it. If you can use the exportables function, always go with that. The values function returns more information, but also requires more processing and understanding to handle properly.

⛓ī¸ Interfaces​


🔗 IActionableData​

Describes the interface for a data item in the IActionableNode interface.

Type declaration​
interface IActionableData {
  key: string;Readonly
  name: string;Readonly
  slot: string;Readonly
  datatype: string;Readonly
  string: string;Readonly
  value: any;Readonly
  modified: boolean;Readonly
  reference: string | undefined;Readonly
  time: number | undefined;Readonly
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷ī¸ datatype​

Contains the slot data type.

Type​

string


🏷ī¸ key​

A unique key for the data field.

Type​

string


🏷ī¸ modified​

Contains if the data was modified.

Type​

boolean


🏷ī¸ name​

Contains the name.

Type​

string


🏷ī¸ reference​

Contains the data reference.

Type​

string | undefined


🏷ī¸ slot​

Contains the slot reference.

Type​

string


🏷ī¸ string​

Contains the data as a string.

Type​

string


🏷ī¸ time​

Contains the UTC set time of the data.

Type​

number | undefined


🏷ī¸ value​

Contains the data value.

Type​

any


🔗 IActionableNode​

Describes the interface for a single node in the IActionables interface.

Type declaration​
interface IActionableNode {
  key: string;Readonly
  type: string;Readonly
  version: string;Readonly
  node: IExportableFieldNode;Readonly
  data: IActionableData[];Readonly
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷ī¸ data​

Contains the data array.

Type​

IActionableData[]


🏷ī¸ key​

Contains the node key.

Type​

string


🏷ī¸ node​

Contains the node.

Type​

IExportableFieldNode


🏷ī¸ type​

Contains the block type identifier.

Type​

string


🏷ī¸ version​

Contains the block version.

Type​

string


🔗 IActionables​

Describes the interface for the data object returned by the actionables function.

tip

More information about actionable data can be found in the Post-processing actions guide.

Type declaration​
interface IActionables {
  fingerprint: string;Readonly
  stencil: string;Readonly
  nodes: IActionableNode[];Readonly
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.
JSON Schema​

đŸ“Ĩ Download JSON Schema for IActionables

info

The JSON Schema follows the 2020-12 meta-schema.


🏷ī¸ fingerprint​

Unique fingerprint of the form definition.

tip

Learn more about the form fingerprint.

Type​

string


🏷ī¸ nodes​

Contains the actionable nodes array.

Type​

IActionableNode[]


🏷ī¸ stencil​

Unique data stencil of the form definition.

tip

Learn more about the form data stencil.

Type​

string


🔗 ICSV​

Describes the interface for a CSV object returned by the CSV, CSVWithData, and CSVDiff functions.

Type declaration​
interface ICSV {
  fingerprint: string;Readonly
  stencil: string;Readonly
  fields: string;Readonly
  record: string;Readonly
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷ī¸ fields​

Contains the CSV fields header.

Type​

string


🏷ī¸ fingerprint​

Unique fingerprint of the form definition.

tip

Learn more about the form fingerprint.

Type​

string


🏷ī¸ record​

Contains the CSV record.

Type​

string


🏷ī¸ stencil​

Unique data stencil of the form definition.

tip

Learn more about the form data stencil.

Type​

string


🔗 IDataset​

Describes the dataset object that holds a flat list of fields. Returned by the dataset function. Each field in the list is an object of type IExportableField.

Type declaration​
interface IDataset {
readonly [key: string]: IExportableField | undefined;
}

🔗 IExportableField​

Describes the interface for a single exportable field in the IExportables interface.

Type declaration​
interface IExportableField {
  index: number;Readonly
  key: string;Readonly
  name: string;Readonly
  value: any;Readonly
  string: string;Readonly
  type: string;Readonly
  version: string;Readonly
  node: IExportableFieldNode;Readonly
  slot: string;Readonly
  datatype: string;Readonly
  modified: boolean;Readonly
  reference: string | undefined;Readonly
  time: number | undefined;Readonly
  exportable: boolean;Readonly
  actionable: boolean;Readonly
  form: IExportableFieldForm | undefined;Readonly
  forms: IExportableFieldForm[];Readonly
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷ī¸ actionable​

Specifies if the field is actionable.

Type​

string


🏷ī¸ datatype​

Contains the slot data type.

Type​

string


🏷ī¸ exportable​

Specifies if the field is exportable.

Type​

string


🏷ī¸ form​

Contains the parent nested form that holds this field.

Type​

IExportableFieldForm | undefined


🏷ī¸ forms​

Contains the tree of parent nested forms that hold this field. The first form in the array is the highest form in the form tree. So the last form in the array is the direct parent of the field in question.

Type​

IExportableFieldForm[]


🏷ī¸ index​

Contains the index number of the field in the form.

Type​

number


🏷ī¸ key​

A unique key for the data field.

Type​

string


🏷ī¸ modified​

Contains if the data was modified.

Type​

boolean


🏷ī¸ name​

Contains the name of the field.

Type​

string


🏷ī¸ node​

Contains information about the node.

Type​

IExportableFieldNode


🏷ī¸ reference​

Contains the data reference.

Type​

string | undefined


🏷ī¸ slot​

Contains the slot reference.

Type​

string


🏷ī¸ string​

Contains the data as a string.

Type​

string


🏷ī¸ time​

Contains the UTC set time of the data.

Type​

number | undefined


🏷ī¸ type​

Contains the block type identifier.

Type​

string


🏷ī¸ value​

Contains the raw data value.

Type​

any


🏷ī¸ version​

Contains the block version.

Type​

string


🔗 IExportableFieldForm​

Describes the interface for the form that holds a field.

Type declaration​
interface IExportableFieldForm {
  id: string;Readonly
  name: string | undefined;Readonly
  reference: string | undefined;Readonly
  version: string | undefined;Readonly
  alias: string | undefined;Readonly
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷ī¸ alias​

Alias of the nested form.

Type​

string | undefined


🏷ī¸ id​

Contains the nested form identifier.

Type​

string


🏷ī¸ name​

Name of the nested form.

Type​

string | undefined


🏷ī¸ reference​

Reference of the nested form.

Type​

string | undefined


🏷ī¸ version​

Version of the nested form.

Type​

string | undefined


🔗 IExportableFieldNode​

Describes the interface for a node in the IExportableField interface.

Type declaration​
interface IExportableFieldNode {
  id: string;Readonly
  key: string;Readonly
  context: string;Readonly
  props: () => {};Function
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🏷ī¸ context​

Contains the context identifier for the node.

Type​

string


🏷ī¸ id​

Contains the node identifier.

Type​

string


🏷ī¸ key​

Contains the key of the node within the context.

Type​

string


🏷ī¸ props​

Retrieves a reference to the node props when invoked.

info

The reason this is a function is to ensure that the node props are not included when the object is converted to a JSON string. The node props are part of the form definition and are in most situations not part of the response data that is submitted back to an endpoint. Though it's sometimes useful to be able to retrieve the node props when processing data.

Type​

() =>


🔗 IExportables​

Describes the interface for the data object returned by the exportables, exportablesWithData, and exportablesDiff functions.

Type declaration​
interface IExportables {
  fingerprint: string;Readonly
  stencil: string;Readonly
  fields: IExportableField[];Readonly
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.
JSON Schema​

đŸ“Ĩ Download JSON Schema for IExportables

info

The JSON Schema follows the 2020-12 meta-schema.


🏷ī¸ fields​

Contains the fields array with the data.

Type​

IExportableField[]


🏷ī¸ fingerprint​

Unique fingerprint of the form definition.

tip

Learn more about the form fingerprint.

Type​

string


🏷ī¸ stencil​

Unique data stencil of the form definition.

tip

Learn more about the form data stencil.

Type​

string


🔗 ITypedDataset​

Describes the typed dataset object returned by the typedDataset function.

Type declaration​
interface ITypedDataset {
readonly [key: string]: ITypedDataset | IExportableField | undefined;
}

🔗 IValues​

Describes the interface for the data object returned by the values function.

Type declaration​
interface IValues {
/* Specifies the slot identifier. */
[slot: string]: {
/* Unique fingerprint of the form definition. */
fingerprint: string;

node: {
/* Node identifier. */
id: string;

/* Friendly name of node. */
name: string;
};

block: {
/* Contains the block type identifier. */
type: string;

/* Contains the block version. */
version: string;
};

slot: {
/* Slot identifier. */
id: string;

/* Reference of slot. */
reference: string;

/* Alias or name of slot. */
name: string;

/* Slot label. */
label: string;
};

values: {
/*
* The keys for the contextual values are composed using the condition hashes of the
* context. If the context is global the key of that value is `*`. If the
* context is defined by a single condition, the key is the computed
* hash of the stringified condition data (where the `id` property is set to
* an empty `string`). If the context is defined by 2 or more conditions, the
* computed hashes of these conditions are used to calculate a new hash. The
* computed condition hashes are concatenated in chronological order and then a
* `SHA2_256` hash is generated for this concatenated string. This hash is
* used as key.
*/
[context: string]: {
/* Contains the value. */
value: any;

/* Contains the reference. */
reference: string | undefined;

/* Contains the UTC set time of the value. */
time: number;
} | undefined;
};
} | undefined;
}