Table of Contents
< All Topics
Print

Gnosis Web API Query Syntax

Several Web API methods take a search parameter to filter the database. Here, you would use the Query Syntax to define the filter criteria.

The following v1 Web API methods take a search parameter:

  • api/ItemType/{id}/Values
  • api/ItemType/{solution}/{itemType}/Count
  • api/ItemType/{solution}/{itemType}/Excel
  • api/ItemType/{solution}/{itemType}/PagingValues
  • api/ItemType/{solution}/{itemType}/Values
  • api/System/Users
  • api/View/Items/{viewIdOrFullName}

The following v2 Web API methods take a search parameter:

  • /v2/Items/{collectionPath}
  • /v2/ExportItems/{collectionPath}

Note that the query syntax is rarely used in Gnosis Script since item collections support data queries using a regular filter function that is then automatically translated into the query syntax.

Equal Operators

Conditions are logical expressions:

  • prop = value
    Check if the prop equals some value
  • prop == value
    Check if the prop equals some value

Not Equal Operators

  • prop != value
    Check if the prop does not equal some value
  • prop <> value
    Check if the prop does not equal some value

Less Than Operators

  • prop < value
    Check if the prop is less than some value
  • prop <= value
    Check if the prop is less than or equal to some value

Greater Than Operators

  • prop > value
    Check if the prop is greater than some value
  • prop >= value
    Check if the prop is greater than or equal to some value

Regex Operators

  • prop like value
    Check if the prop is like a value (Regex search)
  • prop ~ value
    Check if the prop is like a value (Regex search)

Not Operator

  • not (prop ~value)
  • !(prop ~ value)
    Check if the prop is not like a value (Regex search)

In Operator

  • prop in [value1, value2]

Prop Expression Value

The prop in the query expression is a property name or path:

  • Name
  • Address.Line1
  • Parent.Address.Line1

Value can be null, true, false, a single quoted string, a double-quoted string, a number (10, -5, 0), or another property name.

OR Operation

The search query can be combined with an (or) operator:

  • condition1 or condition2
    True if either of the conditions is met
  • condition1 | condition2
    True if either of the conditions is met

AND Operator

The search query can be combined with an (and) operator:

  • condition1 and condition2
    True when both conditions are met
  • condition1 & condition2
    True when both conditions are met

Parenthesis

  • condition1 & (condition2 | condition3)