cancel
Showing results for 
Search instead for 
Did you mean: 

Get Approvers Dynamically from SharePoint List

I use Approvals in Flow a lot to automate approval processes for my clients.  I recently had one client request that the designated approvers be pulled from a SharePoint list rather than being added in the Flow itself.  This would enable an end user to update the approvers rather than having to submit a change request for someone in IT to update the Flow.  

 

Setting Up the SharePoint List

 

The first step is to set up the SharePoint list to hold the approvers.  Use the "Custom List" template and create an additional column called "Approvers" which is a Person or Group Field Type.  Make sure to select the option to "Allow Multiple Persons" when setting up the field if you need multiple approvers.  

 

Configuring the Flow

 

Now that we have our approvers list we need to configure the Flow.  I used the "When a New Item is Added, start Approval" Flow template for my SharePoint list that I need the approval process on.  After the "When a New Item is Added" trigger, add an "Initialize Variable" Action.  Call this variable "Approvers" and set it to a string data type.

ApprvVariable.png

  

Next, we need to add a "SharePoint - Get Item" Action.  Point this to the URL and list name of the SharePoint approvals list we created earlier.  This action requires the ID of the item that you want to get from SharePoint so you'll need to put in the ID of the corresponding approver item.

ApprGetItems.png

  

 

Now that we have our approvers item, we need to insert a "Set Variable" action and set the Approvers variable we created earlier to the "Approvers Email" field from our Get Item action.  Once we do that, Flow will automatically wrap the set variable action inside an Apply to Each function because the Approvers field in the list is set to allow multiple.  The important thing to note here is we need to make sure to put a semicolon after the Approver Email field in the Set Variable action.  If you don't do that then the multiple approvers will be strung together and the Flow will error out.  The semicolon seperates the multiple emails and ensures they are registered properly.  

ApprvApplyEach.png

 

 

The last step is to set the Assigned To property in the Approval action to the Approvers variable we just set.  That's all you have to do!  Now an end user can update the approvers in SharePoint without ever having to touch the Flow!  

Comments

Hi April,

I do the exact same step but yet this is not working for me. Smiley Sad Can you help me?
It only works when there is only 1 Person in my sharepoint list. (Approver)

What I want to achieve is for "Multiple Approvers"
Note: I already enabled  the Allow multiple selections in my sharepoint list ( Column )



Sharepoint Multiple.PNG

I also make sure that I add the semicolon (Smiley Wink in setting the variable 

Variable.PNG
Kindest regards,

Mark Joseph Lagan

Hey Mark.  When you say it doesn't work with multiple approvers....do you get any kind of error message you could share?

Meet Our Blog Authors
  • Co-founder of https://plumsail.com, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • Solution Architect with Slalom, and organizer of the Boston Office 365 User Group, and long term SharePoint/Office 365 veteren. Find more at http://www.davidlozzi.com. Follow @DavidLozzi
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc ( https://triad.co.uk)
>