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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / O365 search - 0 or mor...
Power Automate
Unanswered

O365 search - 0 or more than 1 result

(0) ShareShare
ReportReport
Posted on by 4

I have an excel spreadsheet which has a 'User Name' column - this is a free text field.  I consume this field and do a 0365 search to pull back the users email address.  This all works wonderful, but with some conditions that we want to prevent from happening:

1.) User provided in the excel spreadsheet returns many hits in 0365.  Say for example they enter only Jason.  If there are 10 Jason's returned then i get all 10 email addresses returned.  If i restrict to top 1 then I could get an email address for the wrong Jason that is intended.  In this case, I want to email this record to a team member so that they know more than 1 result was returned and we aren't sure who the email should be sent to.  They can then update the spreadsheet for this to be sent later.

2.) Users provides a name that get zero matches.  I also want to send this record to a team member to review and fix.

3.) Blank records - I was able to get these filtered out.....however it would be nice to have all 3 scenarios grouped into one email to a team member to resolve while all other records with only one found email succeeds.

I hope that makes sense.  Let me know if anyone has a good idea.

Categories:
I have the same question (0)
  • Gristy Profile Picture
    2,429 on at

    1) do not do top 1, but instead use the resulting loop to increment a counter, if it ends up greater than 1, email them instead of doing whatever else you are doing

    2) you can do the same as 1 i.e. counter = 0 or counter > 1

    3) you can do a empty(your variable here) expression to check if its empty and increment your counter

     

    Cheers

     

    Chris

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard