Skip to main content

_LookupList

Last updated 25/11/2024

Introduction

This documentation will demonstrate how to use Five's _LookupList display type.

The _LookupList display type 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.

How to Use the _LookupList Display Type

The _LookupList display type requires you to make the selection of _LookupList in the Display Type field. 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.

actionID.fieldID




Before you begin this documentation, please refer to the Introduction to Five's Lookups chapter so you have an understanding of the database design to demonstrate the display type _LookupList. All the tables used to demonstrate Five's lookups are documented in the Introduction to Five's Lookups chapter so you can build them if you wish and use them to learn about our lookup display types.

This documentation is designed for you to build and add data to get an indepth understanding of all of Five's lookup display types.




Add a _LookupList Display Type

The forms created below will be used to dynamically retrieve the Name values from the Substitutes list to populate the Subtitute Ingredient field's lookup on the Recipes form using the display type _LookupList. This will enable you to assign a substitute to a recipe ingredient.



Prerequisite

  • The list you want to retrieve the data from must be on the current form.
For this example, the Substitutes form will be created and attached as a page on the Recipes form.


Table Relationships in the Soul Food Database Model
Figure 1 - Table relationships in the Soul Food database


Steps

1. Click the New Form Wizard button.


New Form Wizard button
Figure 2 - New Form Wizard button


2. Click the lookup icon in the Main Table field and select Substitute.

3. Click the Add Menu Item switch.


Add the Substitutes Form
Figure 3 - Add the Substitutes form


4. Click the Next button.


Next button
Figure 4 - Next button


5. Click the List checkbox for the Name field.


List Checkbox
Figure 5 - List checkbox


6. Click the Save button in the Form Wizard app bar.


Save the Substitutes Form
Figure 6 - Save the Substitutes form



info
The Add Menu Item was turned off for the Substitutes form because it will be added as a page on the Recipes form.

7. Select the Recipes record in the list.

8. Click the Pages tab.


Pages Tab
Figure 7 - Pages tab


9. Click the Add Pages button.


Add Pages Button
Figure 8 - Add Pages button


10. Type Substitutes in the Caption field.

11. Click the lookup icon in the Page Type field and select List.

12. Click the lookup icon in the Action field and select Substitutes (Form).


Add the Substitutes Page
Figure 9 - Add the Substitutes page


13. Click the Save button in the form app bar.


Save the Substitutes Form
Figure 10 - Save the Substitutes form


14. Click the Save button in the form app bar above the list.


Save the Recipes Form
Figure 11 - Save the Recipes form


info

In the Soul Food application, the Recipes form now has two list pages: Recipe Ingredients and Substitutes. Currently, if a substitute is added, the substitute would not dynamically populate in the Substitute Ingredient field on the Recipes Ingredients form as it is a text field and the data is not saved in the backend yet. You can see this in the image below.



No LookupList Display Type
Figure 12 - No LookupList display type


info

The Recipe Ingredients form will be edited to have a _LookupList display type in the Substitute Ingredient field. This will make the substitutes entered to be available on the Recipe Ingredients form before saving the Recipe form.


15. Select the Recipe Ingredients record in the list.

16. Click the Pages tab.


Pages Tab
Figure 13 - Pages tab


17. Select the General record.


General Record
Figure 14 - General record


18. Click the Fields tab.


Fields Tab
Figure 15 - Fields tab


19. Select the Substitute Ingredient record.


Substitute Ingredient Record
Figure 16 - Substitute Ingredient record


20. Either click the Edit button in the form app bar, or click directly in the Display Type field.

21. Click the lookup icon in the Display Type field and select _LookupList.

22. Type Substitutes.Name in the Page List Source field.


Add the LookupList Display Type
Figure 17 - Add the LookupList display type


23. Click the Save button in the form app bar.


Save the Substitute Ingredient Form
Figure 18 - Save the Substitute Ingredient form


24. Click the Save button in the form app bar above the list.


Save the Recipe Ingredients Form
Figure 19 - Save the Recipe Ingredients form


Recipe Form in the Soul Food Application

1. Click the Run button in the toolbar.


Run Button
Figure 20 - Run button


2. Click Recipes in the menu.

3. Select the Lemon Chicken record in the list.


Lemon Chicken Record
Figure 21 - Lemon Chicken record


4. Click the Substitutes tab.


Substitutes Tab
Figure 22 - Substitutes tab


5. Click the Add Substitutes button.


Add Substitutes Button
Figure 23 - Add Substitutes button


6. Type Legs in the Name field.

7. Click the Save button in the form app bar.


Add the Substitute Legs
Figure 24 - Add the substitute Legs


8. Click the Recipe Ingredients tab.


Recipe Ingredients Tab
Figure 25 - Recipe Ingredients Tab


9. Select the Thighs record.


Thighs Record
Figure 26 - Thighs record


10. Either click the Edit button in the form app bar, or click directly in the Substitute Ingredient field.

11. Click the lookup icon in the Substitute Ingredient field and select Legs.


info
The substitute ingredients will now be available to select without having to save the entire record.


Select a Substitute Ingredient
Figure 27 - Select a substitute ingredient


12. Click the Save button in the form app bar.


Save the Recipe Ingredients Form
Figure 28 - Save the Recipe Ingredients form


13. Click the Save button above the list.


Save the Recipes Form
Figure 29 - Save the Recipes form