Entity setter

Introduction:

This action allows to assign a new value to an entity (existing or new).

Supported entity values are:

  • none (an empty string, to clear the value)
  • arbitrary string
  • array (in JSON format)
  • handlebar expression (double curly braces) to assign other entity's value

Multiple assignments get evaluated top to bottom and are chained, which means later ones can take their values from the previous.

Let us demonstrate all possible scenarios. Go to Turn editor > Action and select Entity Setter as the type of action. Fill in the fields as shown.

 

image2.png

 

As the result of this node:

  • entity number will first be set to 123 and then reset to an empty string
  • same_as_number will be 123

array will contain and array of two items - test and abc

 

Entity Setter - Reformat entities

 
 
Entities extracted from external sources may have a format which are not user-friendly or so called 'human readable'. Therefore, it is possible to reformat the entities.
Entities can be formatted using default formats:
  • Time 24:00
  • Time 12:00 AM/PM
  • Date DD-MM-YYYY
  • Regex
Our default formats will convert the format as follow:
 
TIME
To effectively the time formats to convert the time to:
  • Time 24:00
  • Time 12:00 AM/PM
The source entity should contain the format: YYYY-MM-DDTHH:MM:SS
From this format, we will only extract the value : HH:MM
 
DATE
To effectively the time formats to convert the time to:
  • Date DD-MM-YYYY
     
The source entity should contain the format: YYYY-MM-DD
From this format, we will only manipulate the ordering to display DD-MM-YYYY
 
How does it work?
When we are receiving time option such as below,
 
By applying the formatting Time - 24:00, the end- user is now interacting with a better format.
 
 
This will be the result for the end-user.