Is there a AirData Query option for OR function?

Hello,
Is there an AirData query function to have multiple queries to two distinct keys.

I’m looking to query both email address or phone number. I would like the query to find either or.

{ “email”: { “anyOf”: email } , {“anyOf”: phoneNumber}} ← performs an AND function
Based upon the documentation
{ “email”: { “anyOf”: email } OR {“anyOf”: phoneNumber}} ← can we do something like this?

Hi @jeffchen!

is this what you are looking for?

{
  "email": {
    "anyOf": "ismaen@airkit.com"
  }
}
  OR {
    "phoneNumber": {
      "anyOf": "+17148756341"
    }
  }

Let me give that a try

The Query seems to only take the first expression.

Here’s the test case:
{ “phoneNumber”: { “anyOf”: mobilePhone } } OR { “email”: { “anyOf”: email } }
Inputs mobileNumber only → Received result
Input mobileNumber and email → Received result
Input email → No result received

I’m expecting in either case I should receive a result.

Got it! One way I can think of doing it by making two AirData Requests where one filters on the emails, and then the next one filters on the phone numbers.


Then add a transform step that creates an object of the two results using:

FLAT([ airData.results, airData1.results ])

This would get all the results of emails and phone numbers from AirData.

Not sure if you would have duplicates from this, but then you could add another transform data operation and get all the distinct items:

FROM item IN transform SELECT DISTINCT item

hey @jeffchen!

What you’ll want to do here to return all items that match

  { "email": { "anyOf": email }}

And also all items that match

{"phoneNumber": {"anyOf": phoneNumber}}

Is the following:

{
  "email": {
    "anyOf": [ email, NULL ] 
  },
    "phoneNumber": {
      "anyOf": [ phoneNumber, NULL ]
    }
  }

The expression above will return all rows where the email matches the input email, or where the email is EMPTY and all rows where the phoneNumber matches the input phoneNumber, or where the email is EMPTY.

Hope this helps!