web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Search for users (V2) ...
Power Automate
Suggested Answer

Search for users (V2) not filtering on user principle name

(1) ShareShare
ReportReport
Posted on by 6
Hi there,
 
I have a Power Automate flow created to retrieve all employee details that contain a certain string. The flow is functioning well but consumes a lot of time on the search part since I set the retrieving threshold to the max.
 
I want however to use the search input in the 'Search for users (V2)' connector to reduce search time effectively, but whenever I put a string that exists in the user principle names, the result comes back as null.
 
 
 
removing the string from the search input and using the same filter on a filter array returns the right result however after some delay.
 
 
any idea on how to search for a substring in a user principle name in the 'Search for users (V2)' connector?
Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    The issue is that your Search for Users (V2) action (when using a search term) isn't returning any items. When you run the Filter Array action on the results from the Search for Users (V2) action, it won't return any results (since no results were returned initially).
     
    Verify that the user principal name contains the string you have in the search term field. Since your search term is text, the string() function isn't necessary.
     
    It's important to note that the search term looks for matching strings across multiple fields within the Office 365 user directory:
    • Display Name
    • Given Name
    • Surname
    • Mail
    • User Principal Name
    • Job Title
    • Department
    • City
    • State
    • Country
    • Company Name
    • Office Location
    • Mobile Phone
    • Business Phone
    • Fax Number
    • Street Address
    • Postal Code
    • User ID
     
    The search term can be a partial string, meaning it searches for any part of the string within specific fields. However, there are some caveats. To illustrate the caveats I'll be using this demo user's profile:
     
     
    Partial Matches:
    In this example, if you use jess as the search term—it will return all users with "Jess" anywhere in the specified fields (e.g., "Jessica Murray").

    Beginning of Words:
    The search is more effective when the term matches the beginning of words in the fields. Using murr in the search field will find this user because it matches the start of Murray.

    Not Anywhere in the String:
    It doesn't search for the term anywhere in the string. Using ray will not return this user because "ray" is not at the beginning of a word.
     
    In the meantime, if you'd like to learn more about the Filter Array action, you might be interested in the YT Tutorial I've linked below:
     
    To learn more about how to use the Filter Array action, please refer to this YT Tutorial: Are you using the Microsoft Power Automate Filter Array Action wrong?

    In this video tutorial I’ll show you 3 practical ways to use the Filter Array action and how to use it properly.
    1️⃣ Cross-Referencing Data
    2️⃣ Filtering by Key
    3️⃣ Substring Matching

    Did you know that the Condition action has a limit of 10 conditions? Although it might look like the Filter Array action can only accept one condition—this is not true. By using the advanced mode you can enter multiple conditions into a Filter Array action with an expression.

    IN THIS VIDEO:
    ✅ 3 Ways to Use the Filter Array Action
    ✅ How to use the Scope Action to Group Actions
    ✅ How to Check the Number of Items returned from a Filter Array Action
    ✅ How to Cross-Reference Data in Excel with a SharePoint List
    ✅ How the Filter Array Action Works
    ✅ How to Access the Dynamic Content from a Filter Array Action
    ✅ How to Filter Items by a Key
    ✅ How to Filter Items by Matching a Substring
    ✅ How to Use Multiple Conditions in a Filter Array Action
     
     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • Suggested answer
    kimjunmyeon Profile Picture
    6 on at
     
     I want to search for a domain that starts with 'win' in the mail field but that returns null. Does the connector only search for keywords at the start of the values? if so, what would be a good approach to search for specific domains?
  • Suggested answer
    creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    I'd recommend using the List Group Members and Filter Array action.
     
    To learn more about how to use the Filter Array action, please refer to this YT Tutorial: Are you using the Microsoft Power Automate Filter Array Action wrong?

    In this video tutorial I’ll show you 3 practical ways to use the Filter Array action and how to use it properly.
    1️⃣ Cross-Referencing Data
    2️⃣ Filtering by Key
    3️⃣ Substring Matching

    Did you know that the Condition action has a limit of 10 conditions? Although it might look like the Filter Array action can only accept one condition—this is not true. By using the advanced mode you can enter multiple conditions into a Filter Array action with an expression.

    IN THIS VIDEO:
    ✅ 3 Ways to Use the Filter Array Action
    ✅ How to use the Scope Action to Group Actions
    ✅ How to Check the Number of Items returned from a Filter Array Action
    ✅ How to Cross-Reference Data in Excel with a SharePoint List
    ✅ How the Filter Array Action Works
    ✅ How to Access the Dynamic Content from a Filter Array Action
    ✅ How to Filter Items by a Key
    ✅ How to Filter Items by Matching a Substring
    ✅ How to Use Multiple Conditions in a Filter Array Action
     
     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • Ellis Karim Profile Picture
    11,691 Super User 2025 Season 2 on at
    Another method is to use the Search for users (V2) action without any search terms. This will return the first 1000 user accounts.
     
    You can then use the Filter Array action to filter the results.
     
     
    Ellis
     
     
  • kimjunmyeon Profile Picture
    6 on at
    Thank you, ekarim for your response.
     
    This is the method I'm currently using. However, since I'm fetching more than 5k records, it takes a long time to return the result which causes delay in the app.
     
  • VictorIvanidze Profile Picture
    13,073 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard