How-to-guides
Updated:
April 5, 2023

How to pre-fill objects in form submissions

Pre-filling of objects aims to simplify form filling by automatically selecting objects in the form submission. The objects will be pre-filled based on a relation between two or more objects.

Configure pre-filling of objects

Objects can be pre-filled in the form submission based on an existing relation in TE Core, i.e there needs to be a relation configured between two object types. In addition, the relation needs to be mapped in the settings page of TE Preferences.

Go to the settings -> TimeEdit integrations -> Relations. Select to relate the two types to one another.

In the form designer

The pre-filling of objects can either be done between two datasource elements within the same section, or between the primary object and a datasource element. We do not yet support pre-filling of objects between datasources in two different sections, i.e between a regular section and a table section.

Pre-fill between two datasource elements

  1. Add a section in the designer
  2. Add one datasource element
  3. Select the first object type, e.g course event (important so select the actual object and not the field value of an object)
  4. Add a second datasource element
  5. Select the second object type, e.g module (again, important to select the actual object)
  6. If a relation is mapped in the settings page, an option for "Object relations" will automatically appear in the datasource element
  7. Open the dropdown and select to the "course event element"
  8. Open the dropdown for "Pre-fill related objects"
  9. Select one of the three alternatives for pre-filling
  • Don't Prefill - No objects will be prefilled, the related objects will only be shown in the object selection list to the form submitter
  • Prefill, allow editing - Related objects will be prefilled and the submitter can add or remove objects
  • Prefill, do not allow editing - Related objects will be prefilled and the submitter can not edit the objects

Pre-fill between primary object and datasource

  1. Select the primary object type in the settings page of the form designer
  2. Go to the designer tab
  3. Add a section and a datasource element
  4. Select the object type (important so select the actual object and not the field value of an object)
  5. If the selected type and the primary object have a relation, the option to select objects relations appear
  6. Open the dropdown and select "primary object"
  7. Open the dropdown for "Prefill related objects"
  8. Select one of the options which allows pre-filling

Allow multiple values

Please note that if there are multiple objects related to one another, e.g multiple programs related to one course event, remember to enable the option for "Allow multiple values" in the datasource where the objects should be pre-filled. If this option is not enabled, only the first related object in the list will be selected.

It is possible to allow multiple values in both of the datasource elements, e.g the submitter can select multiple course events in one element and then get all of the related programs pre-filled in the other one.

In the form submission

If the option to pre-fill is enabled in the designer, the below example means that based on what course the submitter selects, the related program will be automatically selected. In this example the submitter is allowed to edit.

Customer unique training

This class is available to receive tailor made for your database set-up. Just fill out the form below and our product expert will get in touch with you to set-up your bespoke class.
I want a bespoke class