Lookup Properties

Description

Lookup Properties

Name
Description
Has Lookup value

(Only applies if the field is displayed using a Label control). Specify if the value displayed in the form should be looked up in another data source. E.g. display a product name rather than a product id.

Lookup type

Specify if the value should be looked up in data from another List, or by calling a Javascript function

List name

Specify the name of the lookup List

Key field

Specify the key field in the List.

Return field

Specify the name of the return field.

Javascript function

Specify the name of the function. You function will take the form field value as its input and should return the display value.

You can define lookup fields in the FormView. This allows you to display 'friendly' values in the Form (e.g. product name, rather than product id).

To define a Lookup field, go to the Fields tab in the FormView builder and check the Has Lookup value property.

You can then define the Lookup. The lookup data source can be a List control or a Javascript function.

images/formviewlookup.jpg

Using the Client-Side Data Cache or SQLite in a Lookup

You may want to use the client-side data cache or a query against a SQLite database (in a Cordova application) as the data source for your Lookup. This requires a two-step process because reading data from the client-side data cache, or from a SQLite database can only be done asynchronously. Therefore you must first execute some code that reads the client-side data cache or executes a SQLite query and puts the data in a variable in memory. You can then define the Lookup in the FormView builder to use the Javascript Function option, performing the lookup against the data you have loaded into memory.