_LookupList
Last updated 4/12/2024
Overview
This documentation will demonstrate how to use Five's display type _LookupList. _LookupList enables you to set a field in a list on the current form to use its values as the lookup values in a field. The values will dynamically update in the field's lookup without having to save the form first, as the data will be retrieved from the frontend in combination with the data saved in the backend.
When you select _LookupList, a new field will become available called Page Source List. This will require you to add the field on the current form that will be used to get the values for the field's lookup. For Five to know where the source is, you will need to specify the action ID for the form and the field ID for the field like the example code below.
Let's take a look at an example. In the Soul Food application, there is a form called Recipes that has three pages, General, Recipes, and Substitutes.
The Recipe Ingredients page has a field called Substitute Ingredient.
On the Substitutes page, substitutes for a recipe ingredient can be added. After adding the substitutes and returning to the Recipe Ingredients page, ideally it would be good to have all the substitutes listed in the Substitute Ingredient field without having to save the record first.
If the display type _LookupList is used in the Substitute Ingredient field, the substitutes will be listed in the Substitute Ingredient's lookup.
Back in Five, the Substitute table has been added which has a foreign relationship with the Recipe table and has a Name field.
Form Setup
The Substitutes form has been added which references the data source Substitute table. This form has no menu item.
The Recipe Ingredients form references the data source RecipeIngredient table. This form has no menu item.
The Recipes form has three pages, General, Recipe Ingredients, and Substitutes.
The Recipe Ingredients page is a list page that references the Recipe Ingredients form.
The Substitutes page is a list page that references the Substitutes form.
Add a _LookupList Display Type
The field we need to edit is the Substitute Ingredient field on the Recipe Ingredients form. In the lookup we want the values that are listed in the Substitutes list for the Name field.
1. Select the record in the list.2. Click the Pages tab.
3. Select the page record.
4. Click the Fields tab.
5. Select the field record (Substitute Ingredient field).
6. Either click the Edit button in the form app bar or click directly in the Display Type field.
7. Click the lookup icon in the Display Type field and select _LookupList.
8. Type the action ID for the form and the field ID for the field in the format
9. Click the Save button in the form app bar.
10. Click the Save button in the form app bar above the list.
_LookupList in the Form Wizard
If you know you want to use the display type _LookupList on creation of your form while using the Form Wizard, select _LookupList in the Display Type field. To add the page source list, you will need to edit the form record as documented above to add the action ID and field ID for the source.