Skip to main content

ISlot interface

📖 Description​

Interface that describes a slot within the form definition. Slots serve as the data transporters for the form. Each node block defines the slots required for the data collection of that block.

📃 Type declaration​

info

Besides the listed properties, slots may store additional properties in the slot object.

interface ISlot<T> {
  id: string;Readonly
  type: string;Readonly
  kind: "static" | "dynamic" | "feature" | "meta";Readonly
  reference: string;Readonly
  sequence?: number;ReadonlyOptional
  label?: string;ReadonlyOptional
  name?: string;ReadonlyOptional
  placeholder?: string;ReadonlyOptional
  alias?: string;ReadonlyOptional
  required?: boolean;ReadonlyOptional
  pipeable?: boolean | {
    pipe?: string;
    label?: string;
    alias?: string;
    content?: "value" "label" | "name" | {
      string: string;
      text?: string;
      markdown?: string;
    };
  };ReadonlyOptional
  default?: T;ReadonlyOptional
  exportable?: boolean;ReadonlyOptional
  actionable?: boolean;ReadonlyOptional
  protected?: boolean;ReadonlyOptional
}
🖱ī¸ Hover with the mouse over a property name for a tooltip with the description of that property. Click it for more information.

🗃ī¸ Properties​


🏷ī¸ actionable​

Specifies if the slot is actionable. Actionable slots are special slots used to perform certain actions.

Type​

boolean

tip

More information about post-processing actions and the difference between exportable and actionable data.


🏷ī¸ alias​

Specifies the alias for the slot. Aliases are used in the dataset to identify a certain value.

Type​

string


🏷ī¸ default​

Specifies the default value for the slot.

Type​

T (depends on the slot type)


🏷ī¸ exportable​

Specifies if the slot is exportable. Exportable slots are part of the dataset that contains all the collected values of a form.

Type​

boolean

tip

More information about exportable data.


🏷ī¸ id​

Specifies the unique identifier of the slot.

Type​

string


🏷ī¸ kind​

Specifies the kind of slot. It can be one of the following values:

  • static: Static slots defined by the node block (for example, a slot to hold the value of a text input block);
  • dynamic: Slots defined for dynamic items of a node block (for example, slots for multiple-choice options);
  • feature: Slots defined for certain features of a node block (for example, a slot to hold a score when the score feature of a node block is activated);
  • meta: Slots that hold meta-data for a node block (for example, a slot that holds the time taken for answering a node block).

Type​

"static" | "dynamic" | "feature" | "meta"


🏷ī¸ label​

Specifies a human readable label for the slot.

Type​

string


🏷ī¸ name​

Specifies the slot name.

Type​

string


🏷ī¸ pipeable​

Specifies if the slot is pipeable. Pipeable slots can be used/referenced by other node blocks. It is used to pass information of a block to other blocks, for example, when asking the form respondent for its name and then use that name elsewhere in the form.

info

To simply enable or disable piping for the slot (based on the slot value), supply a boolean value. If you need more control over the pipe, you can supply an object with a more specific configuration.

Type​

boolean | {
/* Optional name for the pipe. This is used to group slot values that have the same pipe name. */
pipe?: string;

/* Optional localized label for the pipe. */
label?: string;

/* Optional alias for the pipe. */
alias?: string;

/*
* Specifies the field or content that should be used as the data that goes
* into the pipe. It can be one of the following values:
* - `value`: Use the current string value of the slot (this is the default behavior);
* - `label`: Use the slot label;
* - `name`: Use the name of the slot;
* - Custom configuration to supply the data that goes into the pipe.
*/
content?: "value" | "label" | "name" | {
/* Contains the content as a string without any markup or variables. */
string: string;

/* Contains the content as text with support for variables. */
text?: string;

/* Contains markdown content with support for basic formatting, hyperlinks, and variables. */
markdown?: string;
};

/*
* Specifies the name of a legacy pipe. Only here for backward compatibility. Do not use.
* @deprecated
*/
legacy?: string; 🗑ī¸
}

🏷ī¸ placeholder​

Specifies the slot placeholder.

Type​

string


🏷ī¸ protected​

Specifies whether the slot is write-protected and can only be changed by the block that created the slot. Other blocks in the form (like the Setter block) cannot change the data of the slot.

Type​

boolean


🏷ī¸ reference​

Contains the slot reference, which is a unique identifier for the slot within the node block. It is used by node blocks to retrieve slots based on the unique reference.

Type​

string


🏷ī¸ required​

Specifies if the slot is required and needs a value before a form can complete.

Type​

boolean

caution

The Runner library will automatically validate if all required slots have a valid value.


🏷ī¸ sequence​

Specifies the sequence of a slot (used to order the slots).

Type​

number


🏷ī¸ type​

Specifies the slot type identifier.

Type​

string