WHERE function

The WHERE function lets you keep only the items that meet a condition, perfect for building option lists or results tables in pages.

Basic syntax 

WHERE has two syntax offerings:

Only keeps the objects where the path exists:

WHERE(array, path)

Only keeps the objects where the field at path equals value:

WHERE(array, path, value)

WHERE example: Filter active users 

Raw data from an API response:

{
  "users": [
    {
      "name": "Alex",
      "active": true
    },
    {
      "name": "Mara",
      "active": false
    },
    {
      "name": "Diego",
      "active": true
    }
  ]
}

WHERE formula applied via the next action in a Value pill:

WHERE(action_name.users, "active", TRUE)

Translation: Only return the objects within the action's "users" array where the "active" key's value is true (boolean).

Event output (see how the "Mara" object wasn't included?):

{
  "data_transform_action": [
    {
      "name": "Alex",
      "active": true
    },
    {
      "name": "Diego",
      "active": true
    }
  ]
}

🖐️ Try this: Configure a WHERE formula 

Was this lesson helpful?

Built by you,
powered by Tines

Already have an account? Log in.