Lookups are represented in three different ways, and you can choose whichever suits your purposes.
- Value Text, represented as a String
- Enumerated Value, represented as an Array
- Lookup ID, represented as an Array
Search by Lookup Value - Value Text
Supported operators for Single Lookup fields are:
eq (= is equal to)ne (<> is not equal to)
The generic format is:
...?$filter=<field_name> <operator> '<value>'
Example:
http://<WebApp URL>/restapi/incident?$filter=consequences ne 'Security'
Search by Lookup Value - Enum
The only operator supported for multi lookups is HAS:
...?$filter=lk_<field_name> has E360.lk_<lookup_name>'lk_<value>'
Example (note the 'lk_' prefix before the field value):
http://<WebApp URL>/restapi/incident?$filter=lk_consequences has E360.lk_incident_consequence'lk_security'
In many cases, the <field_Name> and the <lookup_name> are identical. If necessary, you can use the Metadata call to check for details.
Search by Lookup ID
You can also filter by the ID of the lookup item (e.g. '999999_111') instead for a value (e.g. 'security').
The only operator supported for multi lookups is HAS:
...?$filter=li_<field_name> has E360.li_<lookup_name>'li_<ID_of_value>'
Example (note the 'li_' prefixes):
http://<WebApp URL><WebApp URL>/restapi/incident?$filter=li_consequences has E360.li_incident_consequence'li_9999999_111'
|