SharePoint 2019 MS Flow Integration

In this article, we will explore how we can integrate MS Flow with SharePoint Server 2019 on-premises using the gateway.

Overview

 
MS Flow integration is one of the cloud features and helps to automate the tasks by connecting to various systems. MS Flow gives more flexibility to go beyond creating traditional SharePoint centric workflows by connecting to various services. MS Flow widens the opportunities for SharePoint users to automate their processes.
 
In this article, we will explore how we can integrate MS Flow with SharePoint Server 2019 on-premises using a gateway.
 

MS Flow Overview

 
MS Flow is an app (part of Office 365 Suite) which helps to design and automate business processes and tasks by creating workflows based on certain triggers and actions. It helps to connect to various services including SharePoint, Office 365 Outlook, OneDrive, Twitter, Dropbox, Outlook.com, Dynamics 365, Yammer, Google calendar, Excel, Facebook, Instagram and many more.
 

On-premises Data Gateway

 
On-premises data gateway is a bridge for secure data transfer between on-premises data and Microsoft Flow, and PowerApps services. Follow the below steps to set up the data on-premises data gateway.
  • Download and install the installer from here.
  • On the wizard, read the warning and click "Next".
SharePoint 2019 MS Flow Integration
  • Click “I Accept”. Select the installation location. Click "Install".
SharePoint 2019 MS Flow Integration
  • Provide the email address to use with the gateway. Click “Sign in”. The sign-in account could be an Office 365 account (either a work account or a school account). 
SharePoint 2019 MS Flow Integration
  • Specify the gateway name and recovery key. Click "Configure". 
SharePoint 2019 MS Flow Integration
  • Once installed successfully, the gateway should be online and ready to use.
 SharePoint 2019 MS Flow Integration
  • Click “Service Settings” tab to restart the gateway or change the gateway service account. 
SharePoint 2019 MS Flow Integration
  • Click “Diagnostics” menu to configure the additional logging and test if the gateway can access all the needed network ports.
SharePoint 2019 MS Flow Integration
 

Configure MS Flow Connection 

  • Sign in to MS Flow.
  • On the Home screen, click the gear icon, select "Connections".
SharePoint 2019 MS Flow Integration 
  • The page displays the earlier set-up connections. Click “New connection”.
SharePoint 2019 MS Flow Integration 
  • Select "SharePoint" from the connections list.
  • Select "Connect using on-premises data gateway".
  • Select "Windows Authentication". Provide a username and password to connect to the SharePoint 2019 Farm.
  • Choose the installed gateway.
  • Click "Create".
SharePoint 2019 MS Flow Integration 

Create Microsoft Flow

 
As an example, we will take a simple scenario of an email being triggered to Office 365 Outlook when an item is added or updated in SharePoint 2019 on-premises environment. Once the connection is ready, follow the below steps to create MS Flow.
  • Click “My Flows” from the left menu.
  • Click New > "Create from blank".
SharePoint 2019 MS Flow Integration
  • Click “Create from blank”.
SharePoint 2019 MS Flow Integration 
  • Select SharePoint connector from the list of available connectors.
SharePoint 2019 MS Flow Integration
  • Select the trigger “When an item is created or modified”.
SharePoint 2019 MS Flow Integration
  • Click the menu and select your SharePoint 2019 connection out of all available connections.
SharePoint 2019 MS Flow Integration 
  • Enter the SharePoint 2019 site address and select the list to run the MS Flow on.
SharePoint 2019 MS Flow Integration
  • Click “New step”.
  • Select "Office 365 Outlook".
  • Under Actions, select “Send an email”.
SharePoint 2019 MS Flow Integration
  • Compose the email and give the details for To, Subject, and Body fields respectively.
  • Click "Save".
SharePoint 2019 MS Flow Integration

Test the MS Flow

 
Follow the below steps to test the created MS Flow.
  • Click "Test".
  • Select “I’ll perform the trigger action”.
  • Click “Save and test”.
SharePoint 2019 MS Flow Integration
  • Open the SharePoint list, add a new item.
  • Wait until the flow finishes.
SharePoint 2019 MS Flow Integration 
  • Check the Office 365 Outlook for an email generated from MS Flow.
SharePoint 2019 MS Flow Integration 

Summary

 
MS Flow helps to automate the business processes. This article demonstrated the simple scenario of communicating with SharePoint 2019 on-premises from the cloud using on-premises Data Gateway. In a similar way, complex business processes can be automated using MS Flow.