# Lookup

This Function returns a *\<boolean>*, which is the result of a search for a record in a Database, in compliance with the specified Conditions.

### Parameters

* **Table** *\<unquoted string*> - Table to perform the search on.
* **Column** *\<unquoted string> -* Column where to verify the condition.
* **Operator** *\<unquoted string> -* Operator to apply when verifying the condition. The Possible values for this parameter are:
  * < – Less than.
  * \> - Higher than.
  * <= - Less than or equal to.
  * \>= - Higher than or equal to.
  * \= - Equal to
  * <> - Different from.
  * LIKE - Like to. Use this operator to perform generic searches using character "%".
  * NOT LIKE - Not like to. Use this operator to perform generic searches using character "%".
* **Value** *\<string>* or *\<numeric> -* Value to compare the **Column** to. The type of this parameter depends on the database type of the **Column**.

### **Examples**

Consider the following database table "Products":

| Code | Name       | Stock |
| ---- | ---------- | ----- |
| 001  | Coca Cola  | 100   |
| 002  | Pepsi Cola | 200   |
| 003  | Pork Chops | 300   |

* *Example 1*

Lookup(Products, Stock, >, 100)\
**Result** = TRUE

* *Example 2*

Lookup(Products, Stock, >, 300)\
**Result** = FALSE

* *Example 3*

Lookup(Products, Stock, >, 100, Stock, < 300)\
**Result** = TRUE

* *Example 4*

Lookup(Products, Name, LIKE, "%Cola")\
**Result** = TRUE

* *Example 5*

Lookup(Products, Name, LIKE, "Cola%")\
**Result** = FALSE

* *Example 6*

Lookup(Products, Name, LIKE, "%Cola", Stock, >, 100)\
**Result** = TRUE

{% hint style="info" %}
When you specify more than one condition, the operator used between the conditions is "AND". Therefore, something like "select (...) from (...) where (...) AND (...)" will be executed.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://doc.sysdevmobile.com/kalipso5/developing/form/expressions/functions/functions-descriptions/conditional-functions/lookup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
