cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Test if user found

Dear all,

thanks in advance for an advice to the Power newbie from any of you.

 

I am trying to find user's UPN upon providing his/her DisplayName and create a Planner task assigned to him/her when found. I use 'Office 365 users' and its 'Search for Users (V2}' action. It works perfectly, when user is found. I want to include search result check to the flow and apply another flow steps when he/her not found. How to do that, please? How should I test if 'value' returned from Search for Users is null or not?

 

Many thanks in advance, even for solution proposal of this particular task or for giving me link to another source.

 

Regards,

David 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Test if user found

Hi David,

 

You can try using the Condition branch and check for the length of the value returned from the 'Search for users (V2)'  and use the Yes and No outcome branch to proceed with your flow.

 

Try to use 'length(body('Search_for_users_(V2)')?['value'])' for the condition branch value shown below.

 

Flow Res 1.png

 

I hope you find useful. Please try it out and mark it as a solution if it worked.

 

Regards

Sudharsan K...

View solution in original post

3 REPLIES 3
Highlighted
Dual Super User III
Dual Super User III

Re: Test if user found

Hola David!
"How should I test if 'value' returned from Search for Users is null or not?"
I think there is an easy way to test it. Just create a dummy flow (manually executed", then add an action block "Search for users v2" and add as its input a dummy text. Execute it and inspect its results
Animo!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Super User
Super User

Re: Test if user found

Hi David,

 

You can try using the Condition branch and check for the length of the value returned from the 'Search for users (V2)'  and use the Yes and No outcome branch to proceed with your flow.

 

Try to use 'length(body('Search_for_users_(V2)')?['value'])' for the condition branch value shown below.

 

Flow Res 1.png

 

I hope you find useful. Please try it out and mark it as a solution if it worked.

 

Regards

Sudharsan K...

View solution in original post

Highlighted
Helper I
Helper I

Re: Test if user found

Many thanks. My concept was right (same as yours) my fault was convention of the condition. Works perfectly. Thanks.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,253)