Using the Query Builder/Common Queries in Enquire MAP
Query Builder
Query Builder is a flexible tool that is used to query class objects that are defined in the PeopleSoft HCM metadata repository. Query Builder enables the User to:
- Create queries of unlimited length and complexity without the need to know the underlying database model.
- Function as a powerful feature to use to build Workflow Editor Basics, contact lists, and dynamic blocks in Enquire MAP.
- Enable the User to segment prospects and any related data/ history quickly, accurately, and efficiently in order to get the most out of marketing automation!
- The query builder is very powerful as the UI is designed to simplify the process of creating complex logic.
- The builder allows for 3 sets of nested braces. ((()))
- All logic within a group must have the same boolean operator so the User gets a choice, AND or OR for a group, no combination of such (Group(Filter 1 and Filter 2 and Filter 3). This same rule applies within a block. Group 1 and Group 2 and Group 3. As you can imagine this is also true for blocks. Block 1 or Block 2 or Block 3. Thus it is not possible to do Filter 1 and Filter 2 or Filter 3 as combining and/or within a logic grouping is not possible.
The query builder is probably the most powerful and hence most complex aspect of Enquire MAP
Query Structure
A query is structured into 3 levels; Blocks, Groups, and Filters. The query structure being used is very important to the result of the query itself. Selecting appropriate filters by means of the drop-down menu(s) inside the group.
Blocks
Blocks work exactly the same as Groups where each block is executed as a separate independent query, and the result sets are joined together using the operator the User specifies. When creating a query that says Block A AND NOT Block B, the final result set will be all results from Block A hat are not part of Block B.
Filters
All filters within a specific group are executed together as a single query. This means for the query to return results, each result must match all filters as a group. Ensure that all filters are placed within a single block in order for them to be checked together yet remain dependent on each other.
The above query looks for contacts that have both submitted the form Contact Us and have submitted a field in that form that is United States.
Groups
Each group is run as a separate query, and the results of those queries are combined together with the operator specified. Use different groups or blocks when the User wants the filters to be checked independently.
Above, the first group will look for a contact that Equals (or has participated in) the Campaign 'est Campaign while at the same time Equals (or exists in) the Contact List Test List. Also, the second group asks for a form submit to Exist in general when displaying the results.
The result would be a list of contacts that have participated in campaign Test Campaign, that exist in list Test List, and that have submitted any form in the database.
If the SubmittedForm query in Group 2 was inside Group 1 the form submission would have had to happen inside the campaign and the contact would have to be in the contact list specified.
Blocks work exactly the same as groups. Each block is executed as a separate independent query and the result sets are joined together using the operator specified. If the User creates a query that says Block A AND NOT Block B, the final result set will be all results from Block A that are not part of Block B.
----
Query Building in Different Contexts
Query builder can be used in different areas of Enquire MAP, including the workflow area. Inside workflows, the User will find the decisions section that offers decision blocks that can be based on global query context, campaign query context, or current campaign step context.
Global Query Context
The global query context will look for all records ever created in the database. The only limits to the result set will be defined by the query itself. The global query may look at contacts, or at contact history items.
Contact Lists and Dynamic Lead Scores always run in the global query context. Workflow Decisions have the option of running in this query context as well as other query contexts.
Campaign Query Context
Campaign Query Context will only look at contact history items and results that occurred within the specific campaign.
Workflow Decisions have an option of running in the campaign query context, provided the workflow is part of a campaign. This is the only place this query context is used.
Current Campaign Step
See the image below to select the current campaign step within the workflow decision section.
Common Queries
The Query Builder in Enquire MAP allows the User to personalize and create powerful user journeys for the Company's marketing initiatives. Below are some examples of some common queries using the term eloqua and can be replaced with any other term that would prove useful to Company marketing strategy.
Variations of queries include creating Workflow Editor Basics, contact lists, and dynamic blocks in Enquire MAP:
Page Visit Query
If the contact has visited a page that contains eloqua in its URL, I.E: www.thelandingpage.com/eloqua:
Phone Calls Query
A User can create and track a different telephone number for each of the campaigns (called call tracking number) that via software, records the number of calls received provides a genuine view on how the campaigns are working. These call tracking numbers are purchased in the account:, and Enquire MAP Support and/ or Enquire Account Manager can assist the team with obtaining these.
Live Chat Query
If a contact used the word eloqua during a Chat conversation, the block would be denoted as:
Referral Traffic Query
If the referral source contains eloqua anywhere in the URL:
Custom Field Query
If the organization in the account has a Custom Field Set, I.E.: from a CRM or a manually set field:
Location Query
If the contact has an IP address from Ohio:
If the contact has an organization that is from Ohio:

Accessing History Dates
Every contact history (form submit, webinar registration, email link click, etc) creates a Contact History object (which shows up on the Contact's timeline). When trying to query for a specific history that occurred at a specific time range, use at least two qualifiers: history type and created at.
More Common Queries
AND & OR Operations
The first thing to become familiar with is the basic logic operations available and how they work. There are two logical evaluations used and their respective counter parts. AND, AND NOT, OR, OR NOT:
On the surface it may seem straight forward, and usually it is - for basic queries. However if you're building more complex queries, then it might help to know how these logical operations will evaluate. Skip the "Truth Tables" section below if it is too detailed for Company needs at the moment.
Truth Tables (Advanced)
To dive a little deeper into the digital logic evaluations, below are some basic Truth Tables on how a query shown above would be evaluated depending on whether the operation is an AND, AND NOT, OR, OR NOT.Please Note: Notice that "NOT Group 2" is simply the opposite value of "Group 2". "True" = Include the contact for this query"False" = Don't include the contact for this query
Other Operations
There are a number of smaller operations that can be used to build a query. The first field (not in red square below) is the data to look at. The second field (in the red square) has quite a few options to choose from on how to evaluate that piece of data.
Below are all the possible options and what they mean:
- Equals - Include data that equals a specific value or phrase (must be exact)
- Does Not Equal - Exclude data that does NOT equal a specific value or phrase (must be exact)
- Contains - Include data that contains at least a specific phrase. Ex: Contains "DEMAND" would include Enquire MAP
- Does Not Contain - Include data that does NOT contain a specific phrase. Ex: Does Not Contain MAP will NOT include Enquire MAP
- Starts With - Include data that starts with a specific phrase. Ex: Starts With "MAP" would includeEnquire MAP
- Exists - It actually exists in that data field. Ex: Email Address Exists would only look at contacts who have an email address.
- Does Not Exist - It does not exist in the data field. Ex: Email Address Does Not Exist would only look at contacts who do NOT have an email address.
- Greater Than - Anything that is greater than a value specified.
- Less Than - Anything that is less than a value specified.
- Greater Than Or Equal - Anything that is greater than or equal to a value specified. If looking to compare date ranges, use this.
- Less Than Or Equal - Anything that is less than or equal to a value specified.. If looking to compare date ranges, use this.
- Greater Than Numeric - Any numeric value that is greater than a number specified.
- Less Than Numeric - Any numeric value that is less than a number specified.
- Greater Than Or Equal Numeric - Any numerical value that is greater than or equal to a number specified.
- Less Than Or Equal Numeric - Any numerical value that is less than or equal to a number specified.
- Is One Of - Looks for a match that is any one of the options created. Behaves similar to Equals except that with multiple options and look for one that equals any of these options. Ex: Contact history Is One Of form submission, text message
- Is Not One Of - Looks for data that does NOT match any of the values set forth. Behaves similar to Does Not Equal except that with multiple options and look for any thing that does NOT equal any of those values. Ex: Contact history Is Not One Of text message
- Regex - Regex is short for Regular Expressions. This is an advanced tool used to look for patterns in word strings. Example, email addresses. Use regex to look for values that match a format.
- Not Regex - Use this tool to look for values that do NOT match a specific format in Regex.
Accessing History Dates
Every contact history (form submit, webinar registration, email link click, etc) creates a Contact History object (which shows up on the Contact's timeline). If trying to query for a specific history that occurred at a specific time range, the User will need to use at least two qualifiers:
- history type
- created at
Please reach out to the dedicated Enquire Account Manager or Enquire MAP Support team for further assistance.