A data field is a place where you can store data. It also allows you to read and often write or overwrite that data. Here are a few examples of data fields:
- The name and email of a visitor who submits a lead form – are written to text data fields on Audience data
- The current score on a Marketing Game – could be a number data field on Session data, which are both being updated and displayed while the visitor plays the Marketing Game.
- The number of already answered questions on a quiz – is a number data field on that Quiz, which can be read and displayed, but not overwritten.
Where Are Data Fields
Data fields can be found in a variety of places. Here’s where you can find data fields to read and often write data to:
- Session Data data fields exist only during the visitor’s session and are at the heart of the experience’s interactivity, such as the score of a game.
- Audience Data data fields contain data that is saved for each visitor separately, which builds their audience profile, such as name and email.
- Components of an Interactive Experience may also provide data fields, which can be read-only and tell the state of that component, such as a quiz with data fields for how many questions have been answered so far, how many questions it has in total, or how many points the user currently has, or writable data fields such as the minimum and maximum value of a range input, or the current value of a short answer input.
- Addons. Addons enabled on your project may also provide a variety of data fields. For example, if you enable the addon Date & time, you can then access the current year, month, day, hour, minute, and second as data fields.
Types Of Data Fields
Data fields have different types which relate to the type of data they hold. Here is the current list of available data field types.
Text
A text field can hold from a single letter to a sentence or a paragraph.
- Actions
- Modify Action
- Set – change the current text value
- Modify Action
- Conditions
- is equal to
- is different than
- contains
Number
A number data field can be an integer (1, 2, 365, 9001, etc.) or decimal (0.5, 1.618, 3.14, etc.).
- Actions
- Modify Action
- Set – change the current number value
- Increase – add a given amount to the current value
- Decrease – subtract a given amount to the current value
- Modify Action
- Conditions
- is greater than
- is lesser than
- is greater than or equal to
- is lesser than or equal to
- is between
- is different than
- is equal to
True/False
A true/false value is a Boolean value, which can only have the value of true or false.
- Actions
- Modify Action
- Set – change the current value to true or false
- Modify Action
- Conditions
- is true
- is false
List
A list data field is an ordered set of unique text values.
- Actions
- Modify Action
- Set – provided a list of comma separated text values, it resets the list
- Clear – removes all text values on the list
- Add – adds a text value to the list, if not already present
- Remove value – removes a given text value from a list, if present
- Shuffle – randomizes the order of the text values on the list
- Remove from position – given a position from 1 to the number of text values on the list, removes the text value at the given position. The removed value is lost.
- Remove from Action – given a position from 1 to the number of text values on the list, removes the text value at the given position and writes it to another given text data field.
- Modify Action
- Conditions
- contains – a given text value
- does not contain – a given text value
- is empty
Component
A component data field is a reference to an existing component on a project, such as a row, an image, a video, and so on.
- Actions
- Modify Action
- Set – sets the data field to another existing component
- Modify Action
- Conditions
- is equal to
- is different than
Image
An image data field is a text data field that has an image URL.
- Actions
- Modify Action
- Set – change the current image value
- Modify Action
- Conditions
- is equal to
- is different than
- contains
Color
A color data field is a text data field that holds a color value.
- Actions
- Modify Action
- Set – change the current color value
- Modify Action
- Conditions
- is equal to
- is different than
- contains
Tags
A tags data field is a list data field that holds tags. Tags are used to identify or perform certain actions on one or more components and
- Actions
- Modify Action
- Set – provided a list of comma-separated tags, it resets the list
- Clear – removes all tags on the list
- Add – adds a new tag to the list, if not already present
- Remove value – removes a given tag from a list, if present
- Shuffle – randomizes the order of the tags on the list
- Remove from position – given a position from 1 to the number of tags on the list, removes the tag element at the given position.
- Remove from Action – given a position from 1 to the number of tags on the list, removes the tag at the given position and writes it to another given text data field.
- Modify Action
- Conditions
- contains – a given tag
- does not contain – a given tag
- is empty