Related Data Subtables in Forms

March 16, 2014 , by

You can nest Data Models within each other utilizing Pistachio's Relationship field template. Nestings in Data Models map to one-to-many database table relationships. Data Models can be nested on n-levels, with each level mapped out in a Relationship type field template of the parent Model.

Creating a relationship

You create a relationship by creating a field of template type "Relationship". Within this field, you will create a Data Model, if one does not already exists. This is done by clicking the button "Add Sub-Table to Data Model". You will then be provided an interface to create a data model in an overlay window. Please refer to Data Model for detailed instructions.

Configuring a Relationship

Once, you have successfully created the model, close the modal window by clicking on the red X sign on top right. Now, you can see that the Sub-Table select box is not empty, and it has the option to select the new data modal you just created.

The settings specifically associated with * Relationship* type fields are explained below. For other general fields descriptions see Data Model Table Fields.

  • Notes
  • Field Name - A field name to identify the relationship

Data Model

  • Sub Table - specifies the child data model that the current model will be related to
  • Sub-Table Linking Field - a field in the sub table that specifies the foreign key of the data relationship between the parent and child data models.

Display

  • Display Type

    • Subsection - Document (Fixed) - The data model will be displayed in an inline form. The number of inline records will be defined by the Display Size.
    • Subsection - Document (Resizable) - The data model will be displayed in an inline form. The number of inline records can be dynamically defined by the user.
    • Subsection - Drilldown - The data set will be displayed as a results grid within the record.
    • Subsection - Grid (Fixed) - The data set will be displayed in a tabular grid format
    • Subsection - Grid (Resizable) The data set will be displayed in tabular grid form, the size of the grid is resizable by the user.
  • Locked Lookup Field - an optional setting that can be used to "lock" the number of available record slots within an embedded SubSection interface. The slots are "locked" to the values of the lookup table that the selected field element maps to. This field element must belong to the selected child data model and have lookup table information specified within its configuration.This setting has no effect when the display type is Drilldown

  • Display Size - Indicates how many subrecords should be rendered by default for Grid Display/Document Display indicates how many results per page to be displayed for drilldown subsection.