This document explains how to formulate and test your membership queries to ensure the correct employees are returned.
Before you begin
Perform the following tasks before proceeding with the information on this page:
Formulating and testing your query
Membership queries take the form of
target_field condition, and are
Common Expression Language (CEL)
The following example shows how to check for a specific value in a
user.addresses field using the
exists() CEL function:
exists() macro is used to create membership queries for fields of type
Here is an example of checking multiple values, (building)
building_id, in a single list entry:
user.locations.exists(loc, loc.area==`Sunnyvale` && loc.building_id==`Building 1`)
Testing membership queries
To test your membership queries, you can use the simple query builder.
Testing queries with the simple query builder
The simple query builder allows you to use drop-down menus and text fields to enter and test a query. After you are sure the membership query returns the correct results, you can create the corresponding CEL queries with the dynamic groups API.
After you test your membership query, you can use it when creating a group. For more information, refer to Creating a dynamic group.