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

# Zoho CRM Lookup

> Retrieve values from Zoho CRM and insert them into an Arc message in the flow.

The Lookup action retrieves values from Zoho CRM and inserts those values into an existing
Arc message in the flow.

<ol><li>In the CData Arc flow, drag an arrow from the connector that will provide input to the Zoho CRM connector.</li>
<li>Optionally, choose a **Sample File**. A sample file is recommended because it allows the connector to provide more context about the file structure and helps you build [filter](#filters) conditions.</li>
<li>Once you have completed the configuration steps below, in the Arc flow, drag an arrow from the Zoho CRM connector to the connector where you want your resulting XML or Header data to go.</li></ol>

## Lookup Configuration

Use this section to define the table and columns to include in your query.
[Designer Mode](#designer-mode) helps you pick the table and columns you want to
target with your query, instead of requiring you to build the query free form. However, you can
use [Query Mode](#query-mode) if you prefer to write your query from scratch.

### Designer Mode

Follow the steps below to use the Designer to configure a Lookup action for the Zoho CRM connector.

![Lookup designer](https://docs.arc.cdata.com/26.2/images/dbsa_lookup_designer.png)

<ol><li>Use the **Table** drop-down to select the table to include.</li>
<li>Choose the set of **Columns** that you want to include from the table.</li>
<li>**Output Destination**: select **XPath** to insert the query response values into an XML file or **Header** to insert the query response value into a message header.
<ul><li>XPath: When you choose XPath, the destination is in two parts. The **Parent-Level XPath** should already exist in the XML document. The **New Node Name** is the name of the node that is injected into the XML document to hold the result of the lookup. Each column in the query has its own XML element (leaf level) in the XML element provided here.</li>
<li>Header: When you choose Header, the connector adds one header to the output message for each column in the query. The values are comma-separated for each record that is returned from the database.</li></ul></li>
<li>Use **Record Limit** to specify what should happen when the query returns multiple results.
<ul><li>If you choose **Use First Result** from the dropdown, you can use the **Error if multiple results** to see an error when multiple results are returned.</li>
<li>If you choose **Custom Limit**, you must specify the limit in the field that appears.</li></ul></li>
<li>Use **Order by** to choose which column to order the results by.</li>
<li>The [Filters](#filters) section lets you create filters to build the query WHERE clause, including references to headers or XML from the input file.</li></ol>

### Filters

You can build complex filters by defining individual filters and/or groups of filters. For
readability, expand the **Filters** section by clicking the expander icon ![expander](https://docs.arc.cdata.com/26.2/images/validate_expander.png) on the
right side of the bar.

To add a filter, click **Add Filter** or **Add Group**.

When you build your filters, use the dropdowns to make your selections and choose your
operator. Then specify the value to filter by. You can choose from the following:

<ul><li>Message Header</li>
<li>Input XML</li>
<li>Static Value</li></ul>

When you select Input XML for a filter, if you have uploaded a sample file, the editor displays
a tree representation of the document so you can easily find the XPath you need, as shown in
the image below.

![Lookup filter configuration](https://docs.arc.cdata.com/26.2/images/dbsa_lookup_filter.png)

You can reorder filters and groups. Click the handle ![handle](https://docs.arc.cdata.com/26.2/images/xmlmap_condition_handle.png) and drag the object to a new location.

### Query Mode

Follow the steps below to use the Query mode to configure a Lookup action for the Zoho CRM connector.

![Lookup query mode](https://docs.arc.cdata.com/26.2/images/dbsa_lookup_query.png)

<ol><li>**Output Destination**: select **XPath** to insert the query response values into an XML file or **Header** to insert the query response value into a message header.
<ul><li>XPath: When you choose XPath, the destination is in two parts. The **Parent-Level XPath** should already exist in the XML document. The **New Node Name** is the name of the node that is injected into the XML document to hold the result of the lookup. Each column in the query has its own XML element (leaf level) in the XML element provided here.</li>
<li>Header: When you choose Header, the connector adds one header to the output message for each column in the query. The values are comma-separated for each record that is returned from the database.</li></ul></li>
<li>In **Query**, enter the SQL query to retrieve data from Zoho CRM tables.
<ul><li>XPath: Format the path as `${XPATH:/path/to/element}`. For example, `SELECT CustomerID FROM Customers WHERE CustomerName = ${XPATH:/Items/Invoices/Customer}`.</li>
<li>Header: Format the path as `${HEADER:HeaderName}`.</li></ul></li>
<li>The two checkboxes let you configure what should happen when the query returns multiple results.
<ul><li>Check **Use First Result** to always use the first result.</li>
<li>Check **Error if multiple results** to see an error when multiple results are returned.</li></ul></li></ol>

## Advanced

![Lookup advanced settings](https://docs.arc.cdata.com/26.2/images/dbsa_lookup_advanced.png)
<ol><li>Use **No Matching Record Found Action** to specify what should happen if no record is found that matches the query.</li>
<li>The Zoho CRM connector can perform Lookup queries against a local cache instead of
querying Zoho CRM directly for each Lookup. This can improve query performance,
especially with larger databases. To enable this, check **Enable cache** and
configure the rest of the fields.
<ul><li>**Cache Tolerance**: Controls how often the connector issues a query to the data source to refresh the cache.</li>
<li>**Cache Tolerance Unit**: The **Cache Tolerance** unit. Choose Minute, Hour, or Day.</li>
<li>**Cache Provider**: Choose which driver to use to facilitate the connection to the cache database.</li>
<li>**Connection String**: When set, the connector uses the database specified here for caching.</li></ul></li></ol>

> [!NOTE]
>
> <ul><li>If a query returns no results from the cache, the connector queries Zoho CRM directly.</li>
> <li>If your query statement contains a `limit`, `offset`, or `groupby` parameter, the cache function does not work. These queries go directly to Zoho CRM.</li></ul>

## Test Lookup

Use the **Test Lookup** button to check your configuration and see the result
without having to process files manually. Use the **Save Sample Data** button to
save the output as a sample for mapping later in the flow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.