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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get employee name usin...
Power Automate
Unanswered

Get employee name using ID from different SharePoint list

(0) ShareShare
ReportReport
Posted on by 126

I have two lists (Employees & Medicals) and need a flow to send an email when an employees next medical assessment is due.

 

The employees names are stored in the Employees list, and the Medicals list only uses their employee ID to identify them.

 

I need the flow to get the employees name from the Employees list using their employee ID from the Medicals list, then add that to an email with the date their medical is due.

 

Any help on this would be great as I can't quite figure it out, thanks.

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    Is your Employee ID column in the Medicals list a Lookup column pointing to the Employees list, or just Single line of text column that contains the Employee ID?

  • aah Profile Picture
    126 on at

    @grantjenkins It's just a single line of text column that contains the Employee ID.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Sorry, should have asked this before. Where do you store the email for each employee in order to send the email? It that another column in the Employee List?

  • aah Profile Picture
    126 on at

    It's no problem. I don't, I use the 'Send an email (V2)' to send the email at the end of the flow to a selected person.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    This is how I would build the flow. I'm assuming you're sending an email for each person that has a medical due. Also, assuming you have a Recurrence trigger set to run daily. For this example, I have two lists.

     

    The Employee List is below.

     

    grantjenkins_5-1669038669442.png

     

    And the Medical List is below:

     

    grantjenkins_6-1669038713839.png

     

    Full flow below. I'll go into each of the actions.

    grantjenkins_3-1669038498773.png

     

    Recurrence is set to run daily.

    grantjenkins_1-1669038292051.png

     

    Get items Medicals will retrieve all medicals that are due today. My internal column name is NextMedicalAssessmentDue. You'll need to find out what your internal name is.

     

    I've also used the following expression to get the current date formatted as yyyy-MM-dd which is the same format that will be returned for each of your items.

    formatDateTime(utcNow(), 'yyyy-MM-dd')

    grantjenkins_2-1669038460019.png

     

    Apply to each Medical uses the value from Get items Medical so it will loop over each of the Medicals returned (ones that are due today).

    grantjenkins_4-1669038579537.png

     

    Get items Employees retrieves employees where the Employee ID matches the Employee ID in the current Medical List. Note that it has Title and Title - this is because I renamed my Title columns to Employee ID in both lists, and we always use the internal column name when applying filters. This should only return a single employee.

    grantjenkins_7-1669038842270.png

     

    Apply to each Employee will then loop through each employee that was returned which should only ever be one, but Power Automate doesn't know this so adds a loop assuming it could be more than one.

    grantjenkins_8-1669038959859.png

     

    Lastly, it will send the email using the properties from both lists. In my example, I'm just sending the email to myself.

    grantjenkins_9-1669039026725.png

     

    The email, as it is in my example, will look like:

    grantjenkins_10-1669039093905.png

  • aah Profile Picture
    126 on at

    @grantjenkins Thanks for this but I can't seem to get it to work. Not sure what's wrong but I'll keep trying 👍

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Are you able to share screenshots of what you currently have and what errors, etc. you are facing?

  • aah Profile Picture
    126 on at

    I was originally using Power Automate to create a HTML table with a list of employee names whose medicals are overdue but this is now only displaying the employee ID after I remade my databases.

    aah_0-1669117227590.png

     

    This would probably have to be a new topic but if there was a way to integrate getting the name from the employee ID into this flow that would be perfect.

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Sorry for the late reply. Is the Name within your SharePoint List? I'm assuming at the moment your Title field contains your Employee ID. Is the Employee Name one of the other columns?

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Sorry for the late reply. Is the Name within your SharePoint List? I'm assuming at the moment your Title field contains your Employee ID. Is the Employee Name one of the other columns?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard