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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Condtion doesn't check...
Power Automate
Answered

Condtion doesn't check results of two 'Search for users (V2)' action correctly

(0) ShareShare
ReportReport
Posted on by 4
Hi,
 
I'm pretty new to Power Automate and try to figure out the following issue:
 
This is my flow:
In my flow, I have two 'Search for users (V2)' actions that check for users with different search terms.
After this, I have a condition, that checks the results of these two actions based on the length of the output:
length(outputs('Search_for_users_(V2)')?['body/value'])
length(outputs('Search_for_users_(V2)_-_varUserCount_eq_0')?['body/value'])
 
In this configuration, I get this error:
Unable to process template language expressions for action 'Existing_user_found' at line '0' and column '0': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Null'.
 
But the left 'Search for users (V2)'-action outputs date, as you can see here:
 
 
My troubleshooting showed, that when I remove the second expression from the condition 'Existing user found', it correctly checks the output of the left 'Search for users (V2)'-action (but fails with the same error in the second run as expected).
So it looks like the condition with two expressions doesn't work the way I think it should.
I hope somebody can help me with this. What can I do so the second condition correctly checks for both 'Search for users (V2)' actions?
Thanks for the help.
Categories:
  • Verified answer
    Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at
     
    Can you try using an empty function instead of the length function? 
     
    Try something like the below: 
    empty(outputs('Search_for_users_(V2)')?['body/value'])
    is equal to 
    true
     
     

    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, Bluesky profile or Youtube Channel
  • Max Power Profile Picture
    4 on at
     
    Thanks for you reply.
    This solved my issue!
     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard