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 / Search for User (V2) w...
Power Automate
Unanswered

Search for User (V2) with variable

(0) ShareShare
ReportReport
Posted on by 99

I'm probably missing something here but I have a variable that's a string type from a prior step called 'NameVariable'

 

to which I'm passing to the Search for users (V2), however results are coming up null.

But when I hard code 'John Doe' into the search it works.  What am I missing here? Do I need to convert the variable that's a string to something else? Compose also doesn't work.  

Categories:
  • VictorIvanidze Profile Picture
    13,083 on at

    Could you show Search for User (V2) with variable in edit mode?

  • IncursioML1 Profile Picture
    99 on at

    It's coming from the text body of an HTML email.

     

    Here's the two outputs if using a variable vs. hardcode in the output.

    There's probably another step I have to do due to the HTML email conversion to text in which the variable is using the final output as a string.

     

    Output of Variable
    "searchTerm": "@variables('FinalBuyerName')",
    "searchTerm": "\n\nJohn Doe\n\n",

     

    Output of HarcCode
    "searchTerm": "John Doe",

  • VictorIvanidze Profile Picture
    13,083 on at

    Well, just remove all \n from variable.

  • brindly Profile Picture
    24 on at

    I'm seeing the same thing, When hard coded, the search string works fine, but when passed from a variable, its Null. Any idea please?

  • brindly Profile Picture
    24 on at

    Sorry about my previous message, It worked. 

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 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard