Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Lookup E-mail

Like (0) ShareShare
ReportReport
Posted on 18 Aug 2023 16:55:19 by

Hi Everyone,

 

Being fairly new to power automate, I'm reaching out to the community to get some assistance. To give some context I need to build an employee appreciation workflow using a Microsoft form that asks an employee to select a thank you card and then enter who they would like to give the card to (First and last name). The end result is to get this information, pull it from a list and send an email.

 

In the back end I've set up a Microsoft list that will grab this information and compile it for me. I've had some suggest to have an email field in the form itself, however because we have over 5000 employees, not everyone is going to know emails. Somehow, I'd like this lookup to work in some way. 

 

Individuals need to enter in a person's first and last name (same field) but I want power automate to look up the entered first and last name and then find their email (I believe get user would do this) and then populate that field into a list that I've created as noted above.

 

Is there a way to do this? I would definitely appreciate any help or support

  • rzaneti Profile Picture
    3,839 Super User 2025 Season 1 on 18 Aug 2023 at 20:44:19
    Re: Lookup E-mail

    Hi @Anonymous ,

     

    I recommend you to create a test flow with a manual trigger and insert the employee name as input to 'Search for users' action (without dynamic content). It will allow to test if (1) the employee name stored in the SharePoint List matches to the name stored in Microsoft Account, and (2) that the account that authenticated the connection with the 365 Users connector has sufficient permissions to search for users. 

     

    If after running this test you can find the user profile, please confirm if the name stored in the SharePoint List contains any unexpected blank space or character. 

     

    If you still cannot find any user profile after this test, confirm that the account connected to the 365 Users has the proper permissions. 

     

    Also, make sure to change the variable data type to 'string' (right now it is assigned as boolean). It is not the cause of the bug that you are facing, but it can result in errors when we solve this first issue 🙂

  • Community Power Platform Member Profile Picture
    on 18 Aug 2023 at 20:16:48
    Re: Lookup E-mail

    Hi @rzaneti 

     

    I gave your suggestion a try. Unless I'm doing something incorrect here. I want the flow to start when a SharePoint item is added (via Microsoft forms into my sharepoint list). Then using your suggestion, I want to use the field on my list "Enter in the employee's name" which has the employee's first and last name as the search term. This would be your "john smith" in your example. It seems like after running it, the flow just stops at the "set variable" function.

     

    Dennis22_0-1692389220844.png  

     

    Test:

     

    Dennis22_2-1692389714447.png

     

     

     

     

     

  • rzaneti Profile Picture
    3,839 Super User 2025 Season 1 on 18 Aug 2023 at 18:06:08
    Re: Lookup E-mail

    Hi @Anonymous,

     

    You can use the 'Search for users' action, which is very similar to the 'Get user', but does not require you to provide the user ID or email (you can search by name). Here is an example:

    rzaneti_0-1692381788293.png

     

    I'm asking Power Automate to search for users in my organization which name is 'John Smith' and store their email address into a variable. I had to setup an 'Apply to each' loop just because the 'Search for users' returns an array of users (ideally with a single user). The output looks like this:

    rzaneti_1-1692381882513.png

     

    You just need to have in mind that this approach may return multiple email addresses if you have a same user with more than one account in your organization. If this is a concern for you, we can create a workaround for that.

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started