Using a Lookup allows you to create a mapping between two Apps to pull information back from data stored in a lookup App and use it in the Main App. In this article, we will demonstrate this capability by showing how to create a database for Companies (Lookup App) and use this to populate the Company information in a Risk (Main App).
Create a Resource App
A Resource App is the source of data that will populate the Fields in your Main App. It will need to contain a Field for each piece of information that you need to populate. For our example, we have created a Companies App that contains the Name, Location, Industry Sector, Contact and Contact No.
By Adding Records to this Company lookup App, each Record then becomes a Company that can be selected when using the LookUp Field to populate the Company information in the Risk.
Create Fields in your Main App
For every Field value in the Resource App that you would like to be populated in the Main App via the Lookup, you will need an equivalent Field in the Main App. The Field should be a match for Field Type as well to ensure that data keeps it's. Here we have created Fields in our Risks App as a destination for the values that are being mapped from the Company lookup App.
Here, we have added them to their own template called Company.
Create a Lookup Field to Pull In the Data
Now that we have a lookup App that is the source for the data and similar Fields in our Main App, we can create the mappings to use the data in our lookup App to populate Fields in the Main App.
In your Main App, add a new field and select the Field Type as 'Lookup'. The label for the Field is the instruction for Users to use this Field to perform the Lookup of data.
This will then ask for two pieces of data. The first is the 'Lookup Name' which is the name of the App that you are looking up the data from. In our example, this is the Company Lookup. The Field also requires a 'Lookup Search Field'. This is a Field from the App that if a user starts to type in the Lookup Field before selecting the magnifying glass to perform the search, will filter down the results in the Lookup pane to only show those that contain the typed text in the selected Resource App Field.
Tip: You can create a Field in the Resource App that concatenates the text of multiple Fields making more than one Field the Lookup Search Field. Here we could add a Field in the Resources App called Name & Location with expression [CompanyName] + '-' + [CompanyLocation]. If we selected this as the Lookup Search Field then it would perform a search on Name or Location
Selecting a Table Report for a Lookup - More on Table Reports
The section labelled 'Report Identifier' now allows you to select a Table Report for the Lookup. If you fail to select one the Lookup will use the App's default List Report, this can generate issues as often they may have Base Filters. Consequently, due to these filters, the Lookup can be left without the full library of Records to 'Look' through.
Therefore, the selection of a Table Report is highly recommended as you can configure this with all your desired Lookup data and ensure that no Filters are applied so the Lookup can 'Look' through all Records in the App. In addition to this, the use of a Table Report specifically for a Lookup Field give the User a more dynamic Tabular Lookup pane within the app As highlighted below, it is Searchable, Filterable and Scrollable.
After configuring the above options, you will then need to determine the mappings for the data. Each piece of information passed from the Resource App to the Main App is a single mapping.
To add a new Mapping first click on 'Add Item'. You will then need to define three things for each mapping:
Identifier: This is the unique reference to the mapping within the set of Field Mappings for the Lookup.
Parent Field: The Parent Field is the Field from thee Resource App that contains the value you would like to move across to the Main App.
Child Field: The Child Field is the Field in the Main App that the value from the Resource App should be mapped to.
Once you are happy with the Field Mappings, save the Lookup Field and add it to a template near the Fields that you are using the Lookup to populate data for.
To see more on how too use a lookup expression, please click here