Forum Discussion

BeauPowell's avatar
BeauPowell
Qrew Member
3 years ago

QuickBase API Query - filter results based on User Emails

Hi all -

First time posting here. Thanks in advance! I am working with the QuickBase API using a tool called Data Fetcher (which is an integration in AirTable). I am struggling to find a way to filter my query results based on subset of users that are associated with a certain record (field ID 35 in my case). The query filter appears to be applying operator to Field 35 Name Value while a User ID and Email value exist and are returned along with the results, I can't figure out how to use them as my query filter. ​

Here's my existing query which works but I would like to be able to specify user emails instead of first names.

{
"from": "TABLEIDHERE",
"where": "({36.IR.'today'}OR{36.IR.'yesterday'}) AND ({35.CT.'Rudolph'}OR{35.CT.'Jack'})",
"select": [
3,
3148,
3143,
3133,
36,
35,
401,
3149,
3147,
3130
],
"sortBy": [
{
"order": "DESC",
"fieldId": 36
}
],
"options": {
"top": 0,
"skip": 0,
"compareWithAppLocalTime": false
}
}

------------------------------
Beau Powell
------------------------------

2 Replies

  • Hi Beau,

    If you have the email address you want to filter with using field ID 35, you can use the HAS query:

    {
    "from": "TABLEIDHERE",
    "where": "({36.IR.'today'}OR{36.IR.'yesterday'}) AND ({35.HAS.'rudolphemail@email.com'}OR{35.HAS.'jackemail@email.com'})",
    "select": [
    3,
    3148,
    3143,
    3133,
    36,
    35,
    401,
    3149,
    3147,
    3130
    ],
    "sortBy": [
    {
    "order": "DESC",
    "fieldId": 36
    }
    ],
    "options": {
    "top": 0,
    "skip": 0,
    "compareWithAppLocalTime": false
    }
    }

    I hope that works! Let me know if not.

    Here is a snippet of the documentation on the HAS Query:

    HAS

    Contains a specific set of users. Used with list-user fields only.

    For each user you are trying to find, you must enter the user's ID, user name, or email address. You can also enter placeholder names. Be sure to surround placeholder names with double quotes.

    The query parameter must be surrounded by single quotes.

    Separate users in the list using a semi-colon.

    For example:

    <query>{'6'.HAS.'-8675309; -9873297'}</query>



    ------------------------------
    Sean Connaughton
    ------------------------------
    • BeauPowell's avatar
      BeauPowell
      Qrew Member
      Hi Sean,

      Thanks for the response! I did try this though and the query doesn't return any results. When I use the query I posted in my original post, I get a response of 6 results. The response does include all of the user properties as (35 value ID, 35 value email, 35 value name). I took one of the emails included in the response and modified my query using the HAS operator instead, and I get no results!

      Beau

      ------------------------------
      Beau Powell
      ------------------------------