# Combined Enrichment

Person and company profile in one lookup, from an email. One lookup for both the person and their company, from an email.

**Credits:** 2 search credits when found. Lookups that find nothing cost nothing. See [Pricing and limits](../pricing-and-limits).

## Inputs and options

Input: `email` (Email address)

This tool has no options.

## Try one value

```sql
CALL TOMBA.core.combined_enrichment('jane.doe@acme.com');
```

The call returns the result as a `VARIANT` (example values, shortened):

```json
{
    "status": "found",
    "credits": 2,
    "results": [
        {
            "FULL_NAME": "Jane Doe",
            "TITLE": "Head of Sales",
            "COMPANY_NAME": "Acme",
            "COMPANY_INDUSTRY": "Software Development",
            "COMPANY_EMPLOYEES": "51-200"
        }
    ]
}
```

`status` is `found`, `not_found`, `invalid` or `error`; `results` holds the output columns and `data` the complete
Tomba record.

## Run it over a table

Create a small table to try it (or use one of yours, after [granting the app access](../installation#3-let-the-app-read-your-tables)):

```sql
CREATE OR REPLACE TABLE my_db.public.signups (EMAIL STRING);
INSERT INTO my_db.public.signups VALUES
    ('jane.doe@acme.com');
GRANT SELECT ON TABLE my_db.public.signups TO APPLICATION TOMBA;
```

Run the tool, then read the results:

```sql
CALL TOMBA.core.enrich_combined('MY_DB.PUBLIC.SIGNUPS', 'EMAIL', 'SIGNUPS_COMBINED_ENRICHMENT', 100);

SELECT INPUT_EMAIL, FULL_NAME, TITLE, SENIORITY, COMPANY_NAME, COMPANY_INDUSTRY, COMPANY_EMPLOYEES, COMPANY_COUNTRY
  FROM TOMBA.results.SIGNUPS_COMBINED_ENRICHMENT
 WHERE lookup_status = 'found';
```

Signature: `enrich_combined(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`

<Callout type="tip">
    Start with a small `max_rows` (like 100) to check the match rate on your
    data, then run the whole table, in the [background](../background-runs) if
    it is large.
</Callout>

## Output columns

Each row starts with `INPUT_<name>` columns (your values, unchanged) and then has:

`EMAIL`, `FULL_NAME`, `FIRST_NAME`, `LAST_NAME`, `TITLE`, `ROLE`, `SENIORITY`, `COMPANY_NAME`, `COMPANY_DOMAIN`, `LOCATION`, `CITY`, `COUNTRY`, `LINKEDIN_HANDLE`, `TWITTER_HANDLE`, `GITHUB_HANDLE`, `COMPANY_INDUSTRY`, `COMPANY_EMPLOYEES`, `COMPANY_COUNTRY`, `COMPANY_LINKEDIN_HANDLE`, followed by the [common columns](../reference/output-columns)
(`LOOKUP_STATUS`, `CREDITS`, `DATA`, `SOURCE`, …).

## Tips

- Costs 2 credits when found, the same as Person Enrichment plus Company Enrichment, in one call.

## Related

- [Person Enrichment](./person-enrichment)
- [Company Enrichment](./company-enrichment)
