Create a Virtual Field

You might want to create a virtual field if you would like to combine multiple fields together into a single field that you can add to your layouts. For example, you can create a single field that combines several contact details stored in different fields in the layout. A virtual field is similar to a calculated field, except:

  • the referenced fields can be edited in the layout; and
  • the virtual field is rendered using a field template.

When you add a virtual field to a layout, you'll define a field template to display it. You'll need to create the field template if it doesn't exist. The template will contain components for each of the referenced fields that you want to display in the layout.

To create a custom virtual field:

  1. Open the dynamic table or form you want to work with in the Layouts tab.
  2. Click the Fields tab, then + Custom Field.
  3. Enter a label for the field (the field's display name) and select the Object (Virtual Field) type. Click Create.
  4. In the Properties pane, click Add next to Fields and select the fields you want to include as reference fields. You can add any field in your layout as a reference field, including sub-fields of objects.
  5. Select a field in the Sort By drop-down list to define the field that should be used for sorting when the virtual field is used in a table.

    Only one field in a virtual field can be used for sorting. For example, if the virtual field FullName consists of a FirstName and LastName field, select LastName if you want it to be used when the table is sorted by FullName. The Sort By field will be used for sorting regardless of how the virtual field is rendered in the table by the template. Remember, you need to use a field template to display a virtual field in a component.

    The table won't be sortable by the virtual field if you don't select a Sort By field.

  6. In the Rule Sets tab, open the layout in the dynamic component where you want to add your field.
  7. Add the virtual field to the layout. You can drag it from the Fields palette into the center pane, or select it in the list and then adjust its position in the center pane.
  8. While your virtual field is selected, define a field template for the virtual field when you add it to a layout.

    If a suitable field template for the virtual field already exists, you can select it in the Template drop-down list in the Properties pane.

    If no template exists, click Create and enter a name for the template in the Label field. Click Create to open the new template in the editor.
    Description of custom_field_virtual_template.png follows
    Description of the illustration custom_field_virtual_template.png

    In the template editor, add a component and define the properties for each referenced field in the virtual field that you want the template to display. Click Return to layout when you're finished.

    The template is applied to your virtual field.

You can add the virtual field to other layouts and apply the same field template, or create other field templates that you apply to the virtual field.