Updated on April 30, 2025.
In this guide:
- Okta Workflows guides
- Search using the ‘co’ (contains) operator
- Search using ‘contains’ with a helper flow
- Related Okta Workflows guides
- Okta Workflows resources
Okta Workflows guides
Okta Workflows guides are questions and answers from the community office hours, the #okta-workflows channel on MacAdmins Slack, and other places. Read all the other guides.
How do you search for users using contains in Okta Workflows?
This guide will teach you how to search for users using contains in Okta Workflows.
Search using the ‘co’ (contains) operator
The following example shows searching for users using the co operator (contains):

The card returns all users containing okta.com in their email attribute:

Note that okta.com can be anywhere in the email string, for instance as in aaron@okta.com.email.
From the Okta developer docs, you can use co only the following user profile attributes:
You can only use
cowith these select user profile attributes:profile.firstName,profile.lastName,profile.email, andprofile.login.
When searching for groups, the co operator supports the following attributes:
You can only use
cowith these select profile attributes:profile.nameandprofile.description
To learn more about the contains operator, refer to Okta’s API Documentation.
Search using ‘contains’ with a helper flow
We published this section as a workaround before the ‘co’ operator became available. We are keeping this section as an alternative solution and example when you need to search using other attributes.
This section will show you how to build a solution for searching for text using contains.
The solution has two flows:
- List Users.
- Search Contains_Helper.
List Users flow
This is the List Users flow:

Note: The List Users with Search card uses the First 200 Matching Records option. This solution will not work with the Streaming option.
The flow has the following steps.
Search users
The Okta – List Users with Search card returns all the Okta users.
Custom filter
The flow passes the users to the List—Filter Custom card. The Filter Custom card uses a helper flow to review each item in the list. The helper flow has logic to search using ‘contains’. The Filter Custom card returns a list of the items that contain the search text.
Search Contains_Helper flow
This is the helper flow.

The flow has the following steps.
Helper flow
The main flow passes each User record to the Helper Flow card. The Helper Flow defines a User record Email property instead of using the Object – Get card to get a property.
Search with contains
The Text – Find card:
Find the first instance of a string within another string.
The flow uses the Find card to search for contains.
In this example, the flow searches for okta.com text in the Email field.
The Find card returns the position (0 is the first position) where the string starts or -1 if no match is found.
Check if a match is found
The True/False – Expression card checks if a text is contained within another string. If the email ends with okta.com, the Expression card returns true. Otherwise, it returns false.
Include the record in the result
The flow passes a true or false value from the previous card to the Return card. If the return value is true, include the current record (User) in the result list. This means the search found a match. If the return value is false, don’t include the current record in the result.
Result
The Okta instance has nine users. Two of them have an okta.com email address. When you run the flow, it finds two matches since two users have an email address with okta.com. The list field in the Filter Custom card holds a list with two records.

Result with two records:

Related Okta Workflows guides
- Search for Users using Custom Search Criteria in Okta Workflows.
- How To Search for Groups Using Custom Search Criteria in Okta Workflows.
Okta Workflows resources
🚀 New to Okta Workflows? The Getting Started with Okta Workflows page has all the resources to help you get started.
📺 Like learning from videos? Watch Okta Workflows videos.
❓Have a question? Ask during community office hours, post on the community forum, or email me.
🙋🏻♀️ Want to learn from the community? Join the #okta-workflows channel on the MacAdmins Slack.
📖 Want to learn more about identity automation? Take Workflows training on Okta Learning.
Leave a comment