Configure Automatic Group Membership in Opensense

Prev Next

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

fields.title == 'Account Executive'

contains

Field value contains the quoted text

fields.title contains 'Sales'

!=

Field value does not equal the quoted text

fields.department != 'Engineering'

Logic operators

Operator

Meaning

Example

and

Both conditions must be true

fields.department == 'Sales' and fields.location == 'New York'

or

Either condition can be true (used to match multiple values)

fields.title == 'Account Executive' or fields.title == 'Sales Rep'

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:

  1. Open a user profile that should match your query and note the exact field value as it appears.

  2. Update your query to match that value exactly, or switch from == to contains to allow for casing variation.

  3. 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:

  1. Review your query for any contains conditions that may be too broad.

  2. Replace contains with == for each condition that should match an exact title.

  3. 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:

  1. Confirm all string values are wrapped in single quotes (e.g., 'Account Executive').

  2. Confirm all operators are lowercase: and, or, contains.

  3. Remove any line breaks, extra spaces, or special characters from the query.

  4. 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)