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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Can I automate checking of user accounts using dynamic value?

(0) ShareShare
ReportReport
Posted on by 157

I am building a flow that takes an email address from a SP form column that a user has input and searches for it using the O365 Card 'Search for users v2'. Now, the output body/value from the Search for users card either look like this if the user doesn't exist:


search-blank.png

Or like this, if they do:

 

Populated-search.png

 

I then have a condition that basically checks if the body is blank, and if so, it goes into send a guest invitation and if not, to tell the person who submitted the form they already exist.

 

I am testing this part for now, and here's how my flow looks:

flow-so-far.png

 

I've tried changing the condition to value equals <left the field blank> and also equals 'null', but whether the email exists or not I the flow proceeds to send the email from the shared mailbox.

 

I've tried using the solution in this post to no avail, as I just get the error: "Unable to process template language expressions for action 'Condition' at line '1' and column '19147': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#length for usage details.'." despite the fact I'm trying to to the exact same thing.

 

This can't be this difficult. Please help!

I have the same question (0)
  • krootz Profile Picture
    458 on at
    Re: Can I automate checking of user accounts using dynamic value?

    @FreddieV  try below:

     

    condition.png

  • FreddieV Profile Picture
    157 on at
    Re: Can I automate checking of user accounts using dynamic value?

    Thanks, but that just produces this error:

     

    error.png

     

    Even if I keep your expression and change it to equals 'null' it still provides the above error.

  • Verified answer
    krootz Profile Picture
    458 on at
    Re: Can I automate checking of user accounts using dynamic value?

    @FreddieV  If you used "length(outputs('Search_for_users_(V2)')?['body/value'])" you'll either get 0 or 1 or more records. The error is suggesting you might be using ['body'] only and not ['body/value'].  Please double check.

  • FreddieV Profile Picture
    157 on at
    Re: Can I automate checking of user accounts using dynamic value?

    Hi thanks, that worked. Why does adding body/value change the output to an array or string?

    The condition needed to be 'equals' though, as "is greater than" caused the flow to still send an email (that the users exists) even though Mickey Mouse doesn't exist within the tenancy:

     

    result.png

     

    Thanks for your help. Much appreciated!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard