> For the complete documentation index, see [llms.txt](https://docs.servoy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.servoy.com/reference/servoyextensions/modules/home-2/svylookup-v1.0.0/api-documentation-v1.0.0.md).

# API Documentation v1.0.0

### Classes

[Lookup](#lookup)\
[LookupField](#lookupfield)

### Functions

[createLookup(dataSource)](#createlookup-datasource-lookup) ⇒ [`Lookup`](#lookup)

Creates a lookup object which can be used to show a pop-up form

### Lookup

* [Lookup](#lookup)
  * [.addField(dataProvider)](#lookup.addfield-dataprovider-lookupfield) ⇒ [`LookupField`](#lookupfield)
  * [.getDataSource()](#lookup.getdatasource-string) ⇒ `String`
  * [.getField(index)](#lookup.getfield-index-lookupfield) ⇒ [`LookupField`](#lookupfield)
  * [.getFieldCount()](#lookup.getfieldcount-number) ⇒ `Number`
  * [.removeField(index)](#lookup.removefield-index)
  * [.showPopUp(callback, target, \[width\], \[height\], \[initialValue\])](#lookup.showpopup-callback-target-width-height-initialvalue)
  * [new Lookup(datasource)](#new-lookup-datasource)

***

#### lookup.addField(dataProvider) ⇒ [`LookupField`](#lookupfield)

Adds a field to the lookup object

| Param        | Type     |
| ------------ | -------- |
| dataProvider | `String` |

***

#### lookup.getDataSource() ⇒ `String`

Gets the data source for this Lookup object

***

#### lookup.getField(index) ⇒ [`LookupField`](#lookupfield)

Gets the field at the specified index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

***

#### lookup.getFieldCount() ⇒ `Number`

Gets the number of fields in the lookup object

***

#### lookup.removeField(index)

Removes a field at the specified index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

***

#### lookup.showPopUp(callback, target, \[width], \[height], \[initialValue])

Shows the lookup

**Suppresswarnings(wrongparameters)**: Fixes illegitmate warning

| Param           | Type               | Description                                                            |
| --------------- | ------------------ | ---------------------------------------------------------------------- |
| callback        | `function`         | The function that will be called when a selection is made              |
| target          | `RuntimeComponent` | The component to show relative to                                      |
| \[width]        | `Number`           | The width of the lookup. Optional. Default is same as target component |
| \[height]       | `Number`           | The height of the lookup. Optional. Default is implementation-specifc. |
| \[initialValue] | `String`           | And initial value to show in the search                                |

***

#### new Lookup(datasource)

| Param      | Type     |
| ---------- | -------- |
| datasource | `String` |

***

### LookupField

* [LookupField](#lookupfield)
  * [.getDataProvider()](#lookupfield.getdataprovider-string) ⇒ `String`
  * [.getFormat()](#lookupfield.getformat-string) ⇒ `String`
  * [.getTitleText()](#lookupfield.gettitletext-string) ⇒ `String`
  * [.getValueListName()](#lookupfield.getvaluelistname-string) ⇒ `String`
  * [.isSearchable()](#lookupfield.issearchable-boolean) ⇒ `Boolean`
  * [.isVisible()](#lookupfield.isvisible-boolean) ⇒ `Boolean`
  * [.setFormat(f)](#lookupfield.setformat-f-lookupfield) ⇒ [`LookupField`](#lookupfield)
  * [.setSearchable(b)](#lookupfield.setsearchable-b-lookupfield) ⇒ [`LookupField`](#lookupfield)
  * [.setTitleText(txt)](#lookupfield.settitletext-txt-lookupfield) ⇒ [`LookupField`](#lookupfield)
  * [.setVisible(b)](#lookupfield.setvisible-b-lookupfield) ⇒ [`LookupField`](#lookupfield)
  * [.setvalueListName(vl)](#lookupfield.setvaluelistname-vl-lookupfield) ⇒ [`LookupField`](#lookupfield)
  * [new LookupField(lookup, dataProvider)](#new-lookupfield-lookup-dataprovider)

***

#### lookupField.getDataProvider() ⇒ `String`

Gets the data provider for this field

***

#### lookupField.getFormat() ⇒ `String`

Gets the display format for this field;

***

#### lookupField.getTitleText() ⇒ `String`

Gets the display text for this field

***

#### lookupField.getValueListName() ⇒ `String`

Gets the value list name for this field

***

#### lookupField.isSearchable() ⇒ `Boolean`

Gets the searchability of this field

***

#### lookupField.isVisible() ⇒ `Boolean`

Indicates if this field should be displayed

***

#### lookupField.setFormat(f) ⇒ [`LookupField`](#lookupfield)

Sets the display format for this field

| Param | Type     |
| ----- | -------- |
| f     | `String` |

***

#### lookupField.setSearchable(b) ⇒ [`LookupField`](#lookupfield)

Indicates if this field is searchable

| Param | Type      | Description                                         |
| ----- | --------- | --------------------------------------------------- |
| b     | `Boolean` | True to make searchable. False to make display-only |

***

#### lookupField.setTitleText(txt) ⇒ [`LookupField`](#lookupfield)

Sets the display text for this field

| Param | Type     |
| ----- | -------- |
| txt   | `String` |

***

#### lookupField.setVisible(b) ⇒ [`LookupField`](#lookupfield)

Sets this field's visibility in the lookup form

| Param | Type      |
| ----- | --------- |
| b     | `Boolean` |

***

#### lookupField.setvalueListName(vl) ⇒ [`LookupField`](#lookupfield)

Sets the valuelist to use to display this field

| Param | Type     |
| ----- | -------- |
| vl    | `String` |

***

#### new LookupField(lookup, dataProvider)

| Param        | Type                |
| ------------ | ------------------- |
| lookup       | [`Lookup`](#lookup) |
| dataProvider |                     |

***

### createLookup(dataSource) ⇒ [`Lookup`](#lookup)

Creates a lookup object which can be used to show a pop-up form

| Param      | Type                                   | Description               |
| ---------- | -------------------------------------- | ------------------------- |
| dataSource | `String` \| `JSFoundSet` \| `JSRecord` | The data source to lookup |

***

#### createLookup\~ds : `String`

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.servoy.com/reference/servoyextensions/modules/home-2/svylookup-v1.0.0/api-documentation-v1.0.0.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
