Overview
Dynamic membership lets you automatically add users to a Group based on their profile fields, such as job title, department, or location. Instead of adding users manually, you write a query that keeps group membership up to date.
Before you start
You'll need:
Admin access to your Opensense account
The exact field values stored in your user profiles (e.g., exact job title strings)
Step-by-step guide
Step 1: Open or Create a Group and select the Dynamic tab
Navigate to Groups under the Manage tab, open the Group you want to configure, and click the Dynamic tab under Membership to access the query editor.
Step 2: Write your query
Type your query into the Query field using the syntax fields.fieldname followMd by an operator and a value in single quotes. The most common field to filter on is fields.title (job title), but you can use any user profile field.
Query syntax reference
Field name format
Always reference fields using dot notation: fields.fieldname. Replace fieldname with the actual field key from your user profile (e.g., fields.title, fields.department, fields.location).
Comparison operators
Operator | Meaning | Example |
|---|---|---|
| Field value matches exactly |
|
| Field value contains the quoted text |
|
| Field value does not equal the quoted text |
|
Logic operators
Operator | Meaning | Example |
|---|---|---|
| Both conditions must be true |
|
| Either condition can be true (used to match multiple values) |
|
Tip: Use == when you know the exact field value. Use containswhen users may have slightly different titles that share a common term (e.g., "Senior Sales Rep" and "Sales Rep" would both match fields.title contains 'Sales Rep').
Examples
Match a single job title
Add all users whose title is exactly "Account Executive":
fields.title == 'Account Executive'
Match multiple job titles
Add users with any of several titles by chaining conditions with or:
fields.title == 'Account Executive' or fields.title == 'Sales Rep' or fields.title == 'Regional Sales Manager'
Match by department and location
Add users who are in the Sales department AND located in Chicago:
fields.department == 'Sales' and fields.location == 'Chicago'
Exclude a group of users
Add all users except those in the Engineering department:
fields.department != 'Engineering'
Troubleshooting
No users are being added despite a valid-looking query
Field values in queries must match what is stored in user profiles exactly, including capitalization. A query using == is case-sensitive.
Steps to fix:
Open a user profile that should match your query and note the exact field value as it appears.
Update your query to match that value exactly, or switch from
==tocontainsto allow for casing variation.Save the query and allow a moment for the Group to refresh.
How to verify it's fixed: The matching users will be displayed under the Dynamic membership tab in the Group.
More users are being added than expected
A broad contains value will match any field value that includes that substring. For example, contains 'Manager' matches "Account Manager," "Marketing Manager," and any other title containing that word.
Steps to fix:
Review your query for any
containsconditions that may be too broad.Replace
containswith==for each condition that should match an exact title.Save the query and review the Users tab to confirm membership is now correct.
How to verify it's fixed: The matching users will be displayed under the Dynamic membership tab in the Group.
The query field shows an error or does not save
Syntax errors prevent the query from saving. The most common causes are missing single quotes, uppercase operators, or stray characters.
Steps to fix:
Confirm all string values are wrapped in single quotes (e.g.,
'Account Executive').Confirm all operators are lowercase:
and,or,contains.Remove any line breaks, extra spaces, or special characters from the query.
Re-enter the query and attempt to save again.
How to verify it's fixed: The query saves without an error message and the Dynamic membership tab populates with matching members.
Still having issues?
Contact our support team at help@opensense.com.
When contacting support, please include:
The full query string you entered
A screenshot of any error message displayed
An example of a user who should be matching but is not (or vice versa)
