Overview

Skill Level: Intermediate

Prerequisites

Multiple Query Expressions allow a user to build a query that contains data filters and search conditions that define the scope of a database search.

Step-by-step

  1. Criteria type and an example calls for Multiple Query Expressions

    Multiple Query Expressions

    Criteria Type

    And/Or

    Left Parens

    Column Name

    Operator

    Values

    Right Parens

    profile

    AND

    (

    first name

    is blank

       

    profile

    OR

     

    age

    is not equal to

    10

     

    profile

    OR

    (

    zipcode

    is equal to one of the following

    30052, 30033

     

    profile

    AND

     

    anniversary

    is not within the last

    5 days

    ))

  2. Example Calls

    The criteria creates editable criteria. When Email is not blank OR Email is equal to test@sp.com

    <Envelope>
      <Body>
        <CreateQuery>
        <PARENT_LIST_ID>348328</PARENT_LIST_ID>
        <QUERY_NAME>xli_test_create_Q2</QUERY_NAME>
        <VISIBILITY>1</VISIBILITY>
        <CRITERIA>
          <EXPRESSION criteria_type="profile">
            <CONJUNCTION>AND</CONJUNCTION>
            <OPERATOR>is not blank</OPERATOR>
            <COLUMN>Email</COLUMN>
          </EXPRESSION>
          <EXPRESSION criteria_type="profile">
            <CONJUNCTION>OR</CONJUNCTION>
            <OPERATOR>is equal to</OPERATOR>
            <COLUMN>Email</COLUMN>
            <WEB_SITE>http://www.ibm.com</WEB_SITE>
            <VALUE>test@sp.com</VALUE>
          </EXPRESSION>
        </CRITERIA>
        <CreateQuery>
      </Body>
    </Envelope>
    

     

     

    Multiple Query Expression Example with Parenthesis

    This criteria creates Editable Criteria:

    When Email is not blank

    OR (Email is not blank

    AND Email is not blank)

    <Envelope>
      <Body>
        <CreateQuery>
        <PARENT_LIST_ID>348328</PARENT_LIST_ID>
        <QUERY_NAME>xli_test_create_Q2</QUERY_NAME>
        <VISIBILITY>1</VISIBILITY>
        <CRITERIA>
          <EXPRESSION criteria_type="profile">
            <CONJUNCTION>AND</CONJUNCTION>
            <OPERATOR>is not blank</OPERATOR>
            <COLUMN>Email</COLUMN>
          </EXPRESSION>
          <EXPRESSION criteria_type="profile">
            <PARENS>(</PARENS>
            <CONJUNCTION>OR</CONJUNCTION>
            <OPERATOR>is not blank</OPERATOR>
            <COLUMN>Email</COLUMN>
          </EXPRESSION>
          <EXPRESSION criteria_type="profile">
            <PARENS>)</PARENS>
            <CONJUNCTION>AND</CONJUNCTION>
            <OPERATOR>is not blank</OPERATOR>
            <COLUMN>Email</COLUMN>
          </EXPRESSION>
        </CRITERIA>
        <CreateQuery>
      </Body>
    </Envelope>
    

2 comments on"Create a Query of a Database by using Multiple Query Expressions"

  1. Is there an XML query to get all available saved queries in the account?

    • Hello Peeyoosh,
      Currently there is not an XML call that will pull all the available saved queries in the account. I will make this suggestion to the development team.

      Thank you,
      Jeri

Join The Discussion

Your email address will not be published. Required fields are marked *