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 Platform Community / Forums / Power Automate / Populating User Nickna...
Power Automate
Unanswered

Populating User Nickname from email address of each member of a Team

(0) ShareShare
ReportReport
Posted on by 27
Some of the data that certain systems within my company outputs depends solely on their employee number.
Their email nickname is the employees surname and their employee number.
 
Example:
 
Name Given Name Surname Employee # email nickname
John Smith John Smith 1234 john.smith@organisation.com smith_1234
 
 
I want to be able to attribute the user profile to the employee. On some sheets, only the Name and Employee Number are listed. I cannot simply concat the name and employee number as some employees have double barrelled surnames that are either hyphenated or separated by a space.
 
There may also be more than one employee with the same name in each team. So emails are likely to be John.Smith1@organisation.com and John.Smith@organisation.com depending on when their outlook profile was created.
 
My idea is to use the output from the Teams channel user data to generate a separate list to lookup against.
 
I have successfully built a flow that populates this data into a List a couple of times a week. I have then tried to add an additional step into the flow that takes the userPrincipalName (email address) from the output of the list members of the Team and then running that through the Get User Profile (V2) connector to get the nickname of each user. The set variable for this was immediately below the Get User Profile as I assumed it would apply this for each user.
 
 
When the flow ran, it did apply the user nickname to each user on the List, but it was the nickname of the last user in the list applied to every user.
 
The above flow is a standard, get data from source, get items from Sharepoint List and the condition is just the length of the row in the list to determine whether to update or create.
 
Can someone advise how to ensure that correct nickname is applied to each userPrincipalName?
 
Many Thanks :) 
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Populating User Nickname from email address of each member of a Team
    The problem is that you have two loops in the flow when you should only have one.  Do the Get Items right at the top of the flow to load the list items into memory.  Then get the group members and loop through them to retrieve each nickname.  As you retrieve each nickname filter the output of the Get Items to an array that matches that particular user's nickname.  Then update the items in the filtered array.  I don't think you need the create item at all.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Verified answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Populating User Nickname from email address of each member of a Team
     
    Just try placing the get user profile under the apply to each loop where you are updating /creating user details in list as shown below
     
     
    This output from the get user profile can give the nickname of each user being iterated and you can use it to update in sharepoint list.
     

    Thanks & Regards,
    Nived N

    Stay connected:
    LinkedIn | YouTube | Blogs

    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

    ​​​​​​​
     
  • Suggested answer
    RhysWilliams Profile Picture
    27 on at
    Populating User Nickname from email address of each member of a Team
    Thanks both, makes perfect sense when pointed out. I'm still trying to get my head around PA after years of using Excel to make things work!

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