The following section describes how to add a Reference field when designing a Form. Reference fields are very powerful fields which make it possible to connect Forms to other Forms or to the built-in Geographic database of ActivityInfo. Users can link their Records to the Records of another Form.
Using a Reference field and multiple Keys in the referenced Form, you can also create a 'cascading' effect to allow users to select from a series of options.
Reference fields vs selection fields
Both Reference and Selection fields allow you to create lists of options. However, as these fields serve different purposes, it is important to choose the appropriate type when designing a Form.
A Selection field allows you to create a list of options inside the Form whereas a Reference field references another Form (a 'Reference Form') where each option is another Record. In the second case, as the option is an actual Record, it is possible to include more information about that option (i.e. meta-data or other kind of information) in the referenced Form. You can use as many fields as needed to capture that information and by making them Key fields you can also bring that information into the initial Form (creating the 'cascading effect').
We strongly suggest the following best practices:
Use a Single Selection field to capture a basic list of options that don't require further meta-data or additional information. Examples: age categories, list of options for biological sex, etc.
Use a Reference field to link to a Reference Form where you will collect additional information for each option (Record). You expect changes to occur on that data (data is described as dynamic rather than static) and you need to link to these options in many Forms in your Database in a consistent way. Examples: partner organizations, list of institutions/entities, etc.
When referencing a Form, users will be able to select from a list of options added to that Form using the Reference field. To limit the options that appear to them to selected options you can set validation rules to the Reference field.
You can add a prefix to the Serial Number to customize it and make it more readable for your users. This allow you to show - without revealing much information- what the Record is about, if you choose to use the Serial Number as the common reference.
The maximum length of the characters of a Key field to appear in a dropdown result of a Reference field is 128 characters.
How to add a Reference field to reference one field of another Form
- Before adding a Reference field, make sure you have defined as Key field the field you want your Form to refer to.
- Navigate to your Form, and in the Form Design page, click on "Reference" to select it from the Fields palette.
Make sure you have defined as Key the field you want your Form to refer to.
- Search for the Database and the Form that contains the Form and the Records you want to link to. Click on the arrows to reveal the contents of each Database.
- Select the Form and click on "Continue".
Fill in the Properties of the Reference field by providing:
- Label: type the question for which the user will select an option
- Description: optionally provide a description
- Code: optionally provide a code
In the Settings check the boxes you want to apply for the field.
- Click on "Done" to add the field.
- The Reference field has been added to the Form.
- When you finish adding fields, click on "Save" to save the Form.
- While adding Records, users will be able to select a Record out of the list of Records of the referenced Form.
While adding Records, users will be able to select a Record out of the list of Records of the referenced Form.
Note that in this example, the referenced field was a Single Selection field, defined as a Key field. That is why users were able to see the specific options in the dropdown list.