cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JustinVoss
Frequent Visitor

Calling User Profiles from a SharePoint List to be used in Multiple Flows

Hi all,

 

Here is my situation:

  • I have multiple flows that have specific people listed in them as decision makers or escalation points
  • Some of these people appear in a number of Flows
  • If someone changes roles, I need to go into each Flow and update accordingly
  • I thought creating a SharePoint list with the people in those roles might be an appropriate solution, referencing that List instead of individually calling them in each Flow - then I can call the Position Short Name (column name) from my list Employees & Positions into the Flows

As an example:

  • Compliance & Systems Manager's Position Short Name is CSM
  • I would like to call the CSM in the Flows they are required to be a decision maker or escalation point and Get User Profile so I can reference whatever is necessary (Name, Email, Manager, etc.) instead of naming the person individually so I have to edit multiple flows if they change roles or leave
  • I was wondering if there was a simpler way to call it to reduce the moving parts
  • I was also sharing this because there might be others wasting their lives searching how to make this work

How it works today...

  1. Initialise Variable, in this instance calling it "CSM_Email" as a String
  2. Using Get Items I call the SharePoint list, in this instance "Employees & Positions"
    1. I use an Filter Query by PositionShortName eq 'CSM'
    2. NOTE: The column field for shortnames requires a UNIQUE value so there cannot be duplicates
  3. Using Apply to Each
    1. Get Item, referencing the ID of the previous Get Items activity
    2. Append to string variable, calling:
      1. Name: CSM_Email (from Initialise Variable earlier)
      2. Value: Email (field in the SharePoint list with the position holder's email)
  4. Using Get user profile (V2) I call on the CSM_Email (from Initialise Variable) to lookup the profile

 

JustinVoss_3-1637630043065.png

JustinVoss_5-1637630547804.png

Would love to hear suggestions on how to make this smarter with less moving parts if possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Hardesh15
Super User
Super User

@JustinVoss  Whatever you design is perfect except Get item action. You do not need this action here. Just use Email directly from loop. Though this small step do not have much impact but it will reduce your API calls count.

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

View solution in original post

4 REPLIES 4
Hardesh15
Super User
Super User

@JustinVoss  Whatever you design is perfect except Get item action. You do not need this action here. Just use Email directly from loop. Though this small step do not have much impact but it will reduce your API calls count.

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

View solution in original post

So I can just have the Append to string variable in the apply to each?

 

I’ll test it out tomorrow and see how it goes. 

@JustinVoss Even you do not need append to string step as well unless you are using that later. And getting employee profile details are also, does not have any specific role here because you are storing employee details on SharePoint until unless you need profile attributes. 

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

If I don't do that when I try to call other components of the user profile later I don't have the options and other components of the Flow fail.

 

I access details like the user's manager, their email, their name, etc.  Cannot call elements of their user profile without appending the string and then using the string to call the user profile.

 

Particularly when Flows might be referring to multiple job roles (instead of defined people).

 

I did remove the other Get Item and it works great.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Users online (2,750)