---
title: "db:lookup — Lookup object (ZeyOS)"
description: "iXML command db:lookup: Lookup object (ZeyOS)."
canonical_url: "https://www.zeyos.com/ixml/ref/db-lookup"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/db-lookup.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# db:lookup — Lookup object (ZeyOS)

DB:LOOKUP looks up a database object and returns it's ID if applicable.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name |
| entity | string |  | Entity |

### Children
- (none)

### Parents
- db:connection

### Result
- binding: var; type: n/a

### Examples

```xml
<db:lookup entity="contacts" var="id">
	<db:is field="lastname">Gates</db:is>
	<db:is field="firstname">Bill</db:is>
</db:lookup>

<if value1="$id" func="=" value2="">
	<output>Contact not found!</output>
</if>

<!-- Contact not found! -->
```
