cancel
Showing results for 
Search instead for 
Did you mean: 
aprildunnam

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
About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: https://ganeshsanapblogs.wordpress.com/about MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: https://linkedin.com/in/manueltgomes and twitter http://twitter.com/manueltgomes. I also write at https://www.manueltgomes.com, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/