Skip to content

Elements

Intro

Elements are the core of Flowcode. They are where the work is done by the app users. Users will spend the majority of their time in the elements.

Element relationships

Elements have a number of relationships:

  • fields()
  • feedback()

Fields

Elements are connected to fields across three tabs

  • Custom
  • Primer
  • Strategy

All three of these relationships are handled using the $element->fields(string $tab) method. The $tab parameter determines which tab relationship to use (of the three above) via a pivot field in the relationship.

Creating fields

It is important to note that you cannot link an existing field to an element, everytime you add a field to an element, or a field group, a new field is created. When a field needs to reference an existing field, a specific type of field will allow the connection.

Element field relationship

This relationship is stored in the element_field table with order pivot and tab pivot

Element Uploads

Element Resources

This relationship is stored in the element_resource table with order pivot

Element Feedback

Element Feedback is only present if the element has been indicated as being markable.