> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Look up customers

> How to look up customers with CRMScript

## Bool findFromEmail(String email)

Looks up a customer in the primary database based on an email address.

```crmscript theme={null}
Customer c;
printLine(c.findFromEmail("jean-luc@superoffice.com").toString());
```

## Bool findExternallyFromEmail(String email)

Same as `findFromEmail()`, but looks in external data sources.

## Bool findExternallyFromEmail(String email, Integer extTable)

A variant of `findExternallyFromEmail()` that limits the look-up to 1 specific source.

## Bool findFromCellphone(String cellphone)

Looks up a customer in the primary database based on a cellphone number.

```crmscript theme={null}
Customer c;
printLine(c.findFromCellphone("12345678").toString());
```

## Integer findExternallyFromKey(Integer table, String key)

Looks up a customer in an external data source (`ext_table.id`) based on its primary key.

* If a match is found in the local proxy, the customer is loaded.
* Otherwise, if a match is found externally, a proxy is created and saved.

## Integer findFromAgentAndKey(Integer agent, String key)

Looks up a customer that is owned by the agent and matches the external key.

Returns the ID of the customer from the database, or -1 if not found.


## Related topics

- [Look up tenant info](/en/developer-portal/tenants/info.md)
- [Look up lists between Source and SuperOffice CRM](/integrations/zapier/howto/listsource.md)
- [Reply to customer](/en/automation/crmscript/howto/request/reply.md)
- [Get customer info](/en/automation/crmscript/howto/contact/get-customer.md)
- [Create and update customers](/en/automation/crmscript/howto/contact/create-customer.md)
