Topics and lessons

References between data items

Some properties for data items are actually other data items. For example, when you have a Project that has Tasks. In this case, you will need a reference.

How to add a reference

  1. Start by adding a property to your data type, and choose reference:
reference-property-type
  1. You will then be asked which data item to reference to. In this example we are adding a property to Project so we select to reference to Task:
reference-to
  1. Give the property a name. It is good to think ahead a bit here, to decide whether you want a singular or plural name. In our case, we want to call the property Tasks because a Project can have more than a single Task related to it:
property-name
  1. Then you have to select how Project is related to Task. In our example, a single Project can have more than one Task:
property-cardinality-1
  1. Then you have to select how Project is related to Task. In our example, a single Project can have more than one Task:
property-cardinality-2
  1. Triggre will also create a property for Task and the final step is to give that property a name. Since we decided a Task to relate only to a single Project we can simply call the property that:
property- name-2
  1. Triggre will show your this reference as a line between the two data item properties:
reference-line
  1. Notice how Tasks is of the property type Task list. This indicates that each project can now have a list of tasks.

    For Task the property type is simply listed as Project. This means every task can only have a single project:
reference-line-2