cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavidDostal
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
sudharsan1985
Solution Sage
Solution Sage

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...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

3 REPLIES 3
efialttes
Super User III
Super User III

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!



sudharsan1985
Solution Sage
Solution Sage

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...

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...

View solution in original post

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,469)