Advanced data link rules

Selecting the Advanced rule checkbox changes the rule editor to enable advanced data linking. Advanced data link rules can be used to:

  • Map data to any custom fields in related data objects, to any level of relationship, by specifying the object and field name relationship (also known as the API name).

  • Create more than one child record for a given object by specifying record numbers (for example to set multiple references or multiple visa records).

When you select Advanced rule, the Form Field and Data Field picklists become the Form Data Name field and Object Field Name field respectively. These fields allow you to type in the field name relationship.

If you have already selected a picklist value for either Form Field or Data Field when you select Advanced rule, the selected value becomes editable text in the new field. It can be useful to pre-select the appropriate Form Field value to avoid having to type it in. You can also select the correct related object as the Data Field value to use as the start of your Object Field Name API name.

Using multi-level object relationships

To use fields in objects that exist in a deeper relationship than is shown in the Data Field drop-down menu, you can specify the linked object in the Object Field Name field, using the Advanced rule option.

The example below is from an HCM form that captures information into the Team Member and the related Dependants object.

Screenshot: multi-level related objects

In this example, the form is linked to the Employment Record object as the link relationship. The form saves personal information for the new employee to fields in the Team Member object, a first-level related object. The example highlighted shows data that is written to a field in the Dependants object, a second-level related object, which has a master-detail relationship to the Team Member object.

The Field Name (API name) is as follows:

fHCM2__Team_Member__r.Dependants__r[0].City_of_birth__c

This API name consists of:

  • Team Member (related object): Team_Member__r

  • Dependants (second-level related object): Dependants__r

  • City of Birth (custom field): fHCM2__City_of_Birth__c

Make sure you use the __r suffix for any related objects and records that appear in your Object Field Name. Specify fields using the __c suffix.

You can create more than one child record for a linked object by specifying record numbers as part of the object field name. This is useful if, for example, if you want to capture details of multiple referees for an application, or multiple passport or visa records for a team member.

To specify multiple child records, add the record number in square brackets after the object name and before the field name. The first record is always identified with a [0]. Subsequent records are specified as [1], [2], and so on. For example:

fHCM2__Team_Member__r.Passports__r[0].fHCM2__PassportNo__c
fHCM2__Team_Member__r.Passports__r[1].fHCM2__PassportNo__c

This example shows a form that captures 2 sets of passport details, for employees who have dual nationality. These are saved as 2 separate records in the Passports object, related to the Team Member record.

The form captures "Country", Expiry, and "PassportNo" fields for two passports:

Screenshot: An example Passport form

The data links for this form link the 2 sets of question fields for Country, Expiry, and Passport Number to a record number [0] and record number [1] in the Passports object. This creates multiple passport entries for your team member.

Screenshot: data link rules

When the details are submitted, two Passport records are created for the team member:

Screenshot: example - passport records updated by data link rules

Tip

Remember to use the NOT (ISBLANK(FormFieldName)) condition in your data link rules. This ensures that fields that are left blank in the form do not create records in your linked object. For example, if the form actor only completes one set of fields on the passport information page, you only want to create one record in the passports object. See NOT (ISBLANK) condition for empty fields.