cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jwheadrick
Frequent Visitor

O365 search - 0 or more than 1 result

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.

1 REPLY 1
Gristy
Resident Rockstar
Resident Rockstar

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

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,719)