There are 2 types of Lookup, Data Lookup and Element Lookup.


Data lookups are used to dynamically populate existing form elements with data. 

Element lookups are user to dynamically generate form elements.


How to Set up


Navigate to the forms builder, in the elements details there are the 'Enable Data Lookup', and 'Enable Element lookup' switchs.

Once a switch is activated you will be need to add a Lookup Source. 

This can be either a custom URL or OneBlink Hosted API route.




Now the element will include a lookup button.

This will be disabled until the input contains a value.





Data Lookup


The Data Lookup feature allows form elements to be populated dynamically based on the values of other elements.

For example, I want to type just the ABN of a business and have the rest of that businesses information automatically populate based on that specific ABN.


When the lookup button is clicked the form submission data is sent to the Lookup Source which dynamically populates the other configured form elements.




Element Lookup


The Element Lookup feature allows the form to be populate dynamically with elements based on the value of another element.

For Example, I want to do a stocktake of a warehouse. I have a list of items I want to check are in the warehouse, but the list of items is different for each warehouse.


When the lookup button is clicked the form submission data is sent to the Lookup Source which dynamically populates the form with the configured elements.

In doing this I can dynamically show the list of items based on the specific warehouse Id. Warehouse 123 has a very different list of items to warehouse 124.





Automatic Lookups


Lookups can be run automatically. If a lookup includes default or pre-populated data, the lookup will automatically run when the form initially loads.


Customise Error Messages


You are also able to add your own unique error messages. 

These are configured in the API.



Offline


Due to the lookup calling an external endpoint this functionality will only work while online.


Create Lookup API


For information on creating your own lookup API, check out our Server CLI examples.