Skip to content

Basic Usage

LtS is built as a jQuery function, so you can call lookupToSelect() on a selector that defines your lookup field (ideally use an id selector ie “#lookup_name”). The simplest version will require next parameters:

  • idFieldName - id field of the table you are fetching data from (example: accountid)
  • textFieldName - primary name field of the table you are fetching data from (example: name)
  • entitySetName - table collection name within Web API (example: accounts). See more details on how to find it/use it in official Power Page documentation
  • targetTableLogicalName - logical name of your table (example: account)

LtS will also handle population of the lookup field with the selected value, so you don’t need to worry about that.

For example: to convert lookup to the Account table with id dwctst_employer we would need to execute following code:

$("#dwctst_employer").lookupToSelect({
idFieldName: 'accountid',
textFieldName: 'name',
entitySetName: 'accounts',
targetTableLogicalName: 'account'
});

Running this code will turn this:

Into this: