---
schema_version: "1"
id: 5ddc1509d3a94893cb80b3269943fc0c6e76ac3d6548804f7b01a0e54f72b821
title: Working with Lookup Query Configurations (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_working_with_lookup_query_configurations.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_working_with_lookup_query_configurations.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 2fd876eb384dfce9e71f9ef548b4a48bf6c341d33f4f0fa0ca7bda6236c832be
description: "For the managed package runtime, when using the Lookup Element in Omniscript, the filtering of results is performed by the Lookup Query Configuration properties section. There are three main types of queries that can be built using this the Lookup Query Configuration properties section: AND join, OR join, and Deep query."
products:
  - Omnistudio
release: "264"
---
# Working with Lookup Query Configurations (Managed Package)

For the managed package runtime, when using the Lookup Element in Omniscript, the filtering of results is performed by the Lookup Query Configuration properties section. There are three main types of queries that can be built using this the Lookup Query Configuration properties section: AND join, OR join, and Deep query.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

**AND Join**

To create AND Join and filter results on two or more fields set the sequence field value to the same value as the fields you want to join together in the query.

**Example AND Join**

![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/salesforce_omniscript_andjoin.png)

In this example, we search for Leads that have Country = "USA" AND City = "San Francisco". This is done by selecting the same Lookup order and populating the JSON Path with the same value.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

The JSON path can be any text but a best practice is to name the JSON Path the object being referenced.

**Deep Query**

To create a Deep query, the Lookup Order is put in sequential order. Omniscript builds smaller query sets at each order set.

**Example Deep Query**

![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/salesforce_omniscript_deepquery.png)

In the example Deep query we are search for Leads that have Country = "USA" AND City = "San Francisco".

The from that data set we also only display Leads that have Industry = "Government". Since we are performing a Deep Query the JSON Path Field Name needs to be updated to populate Accordingly.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

The JSON path in the Field Population property section must match the text used in the JSON Path. A best practice is to separate the JSON Path with a colon to indicate the nested JSON Path.

**OR Join**

OR Joins are not currently supported from within the Omniscript editor so a workaround must be used to accomplish this functionality. To perform an OR Join, a custom formula field on the object can be implemented to accomplish the OR portion of the query such that the formula will return either a TRUE value if the OR query is met and FALSE if not.

**Example with an OR Join**

![image](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/salesforce_omniscript_orjoin.png)

```

The Vlocity_Industry__c formula field example uses this syntax:
IF(
OR(
ISPICKVAL(Industry, "Government"),
ISPICKVAL(Industry, "Insurance"),
ISPICKVAL(Industry, "Communications")

),

"TRUE",

"FALSE")
```

This effectively allows for an OR join even though the Omniscript element doesn't support this functionality directly. In all instances, Filter Values must be text and wrapped in double quotations.