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 users (V2) ...
Power Automate
Answered

Search for users (V2) Lookup User Name by String

(1) ShareShare
ReportReport
Posted on by 17

Hello, I'm having trouble using the Search for users (V2) action in Power Automate to lookup a user's email based on their name as a string. My flow stores a list of users from an Excel document as an array, and appends to the array for each name. Then I use an apply to each for all names in the array to search for users, but I can't get the search for users to return anything from my inputs. My search for users uses this formula: @{variables('PIN Employee Names')} as the search term, and I've attached a picture of the inputs/outputs from my flow runs. Any help would be greatly appreciated, thank you!

Search for users output.png

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @jbl012 ,

    Please check this test:

    Flow Preview:

    vyetonggumsft_0-1719880145962.png

    Flow Configruation:

    vyetonggumsft_1-1719880205135.png

    items('Apply_to_each')?['Name']

    Best Regards,

    Sunshine Gu

  • jbl012 Profile Picture
    17 on at

    Unfortunately still having issues with that flow, it seems the lookup action will not accept my inputs. Here's my error code: Unable to process template language expressions in action 'Search_for_users_(V2)-copy' inputs at line '0' and column '0': 'The template language expression 'items('Apply_to_each_2')?['Name']' cannot be evaluated because property 'Name' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @jbl012 ,

    Could you please show me screenshots of your PIN Employee Names array content format and complete flow?

     

    Best Regards,

    Sunshine Gu

  • jbl012 Profile Picture
    17 on at

    Here are the screenshots, and this is the error message I receive: Unable to process template language expressions in action 'Search_for_users_(V2)-copy' inputs at line '0' and column '0': 'The template language expression 'items('Apply_to_each_2')?['Name']' cannot be evaluated because property 'Name' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.PIN Employee Names Append Array.pngSearch for users.png

  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @jbl012 ,

    The format of your Append to array variable is wrong.

    Please copying this format into Append to array variable Value:

    {
    "Name":"@{outputs('Compose_name_modifier')}"
    }
    

    Best Regards,

    Sunshine Gu 

  • jbl012 Profile Picture
    17 on at

    This worked, thank you!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard