SharePoint 2019 PowerApps Integration

In this article, we will learn how to integrate SharePoint 2019 PowerApps.

Overview

 
SharePoint Server 2019 offers various new features. PowerApps integration is one of the features, that brings in cloud experience to on-premise. Power Apps help to design custom apps for business needs by connecting to various sources or data platforms.
 
In this article, we will explore how we can integrate Power Apps with SharePoint Server 2019 on-premise using a gateway.
 

PowerApps Overview

 
PowerApps helps to build custom apps without writing any code. PowerApps have a responsive design and can work well in the browser and mobile devices. There are two types of PowerApps.
  1. Canvas apps
    Gives the flexibility to arrange the user experience and interface the way we want to configure. We can start creating Canvas app from a blank canvas, data, sample, or common data service source.

  2. Model-driven apps
    This can be created from PowerApps site and helps to rapidly develop forms, business rules, and process flows by using Common Data Service.

Install Gateway

 
In SharePoint 2019, it is possible to use PowerApps in a hybrid environment as well on-premise. Firstly, we need to set up the data gateway for Canvas apps.
  1. Download and install the installer from here.
  2. On the wizard, read the warning and click Next.



  3. Click “I Accept”. Select the installation location. Click Install.

     
  4. Provide the email address to use with the gateway. Click “Sign in” to sign in to PowerApps. The Sign-in account could be Office 365 account (either work or school account).
  5. Specify the gateway name and recovery key. Click "Configure".


  6. Once installed successfully, the gateway should be online and ready to use.


  7. Click “Service Settings” tab to restart the gateway or change gateway service account.


  8. Click “Diagnostics” menu to configure additional logging and test if the gateway can access all needed network ports.

     

Build PowerApps Canvas App

  1. Sign in to PowerApps (https://web.powerapps.com).
  2. On the Home screen, under “Make your own app”, hover “Start from data”. Click “Make this app”.


  3. On the SharePoint tile, click “Phone layout”.


  4. Under Connections, click “New connection” 


  5. From the available list of connections, select SharePoint.
  6. Select “Connect using on-premises data gateway”.
  7. Select Authentication type as Windows.
  8. Specify the username and password to get connected to your SharePoint 2019 on-premise farm.
  9. Select the gateway from the list to use.
  10. Click "Create".


  11. Specify the SharePoint site url to connect to.
  12. Click "Go".


  13. Select the list to connect to or enter custom list name to create. For demonstration purposes, I am selecting the pre-existing Employees list.
  14. Click "Connect".


  15. The app is ready to configure. BrowseScreen1 will help to configure “All items” view. DetailScreen1 will help to configure view item screen. EditScreen1 will help to configure edit item screen.


  16. To verify that the Power App is getting working, let us open DetailScreen1.
  17. Click Insert > Text > Label.


  18. Type in the text as formula as below.
    1. Concatenate("Days since joined: ", Text(DateDiff(DateTimeValue(DataCardValue2.Text),DateTimeValue(Text(Today())),Days)))    
    DataCardValue2 represents Date of joining field.

  19. The label should display the difference between the date of joining and today.


A few considerations for installing gateway:
  1. Do not install gateway on a domain controller
  2. The gateway should be always available. Therefore it should not be installed on a machine that may turn off.
  3. The machine hosting gateway should always be connected to the internet.
  4. Gateway performance might not be good over a wireless network.

Gateway Windows Service

 
Gateway runs as a windows service named “PBIEgwService” (Display name is On-premises data gateway service) under service account NT SERVICE\PBIEgwService.
 
To stop the gateway service -
  1. net stop PBIEgwService  
To start the gateway service -
  1. net start PBIEgwService  
Publish the PowerApps App,
  1. Click File > Save > The Cloud.
  2. Click Save.



  3. Click “Share this app”.



  4. The app can be accessed from web link URL.

Summary

 
The PowerApps feature brings the cloud experience to SharePoint Server 2019 on-premise. We can set up the data gateway for creating Canvas apps. PowerApps have a responsive design and can work well in the browser and mobile devices.