Data types are pre-defined data structures that have many different uses. Among them:
- Providing complete objects as inputs for robots
- Providing a structure in which to build data sets
- Providing standardised outputs for robots
- Manipulating data in pipes robots
Data types and property types
Data types act as object templates - for example, if you create a Person data type, then each Person you create will share the same properties of the same types:
As you can see, properties in a data type can be of the following types:
- True / False
- Multiple choice
Any property can also be defined as a list. Setting a property as a list tells us that the property accepts more than one value, that is to say, it is a list of values of the type given.
We defined id as being a key - this means that the id property is unique, so when there are multiple Person objects in a data set, each person will have a unique id.
In this example, a Person data type contains an id, firstName and lastName text values. Each Person will algo have an age property which has to be a number, attempting to assign it a value which is not a number will result in the value not being assigned. Each Person also has a europeanCitizen property which can either be true or false.
Multiple choice values act as text values, but are restricted to the choices given when creating the data type; in this example, gender can only be the text male or female.
Objects are groups of properties that can be nested indefinitely. In this example, a Person can have multiple socialMedia objects, with each socialMedia object consisting of a service and a accountOrId property. Objects can also contain objects inside of them.