Here we configure our SAP, Teams, and Power Apps environments. We also set up a custom connector to our SAP instance so we can retrieve data.
Microsoft Teams is an effective communication and collaboration tool, especially as we adapt to remote working environments because of the pandemic. Teams’ many out-of-the-box integrations with tools in the Microsoft ecosystem, such as Microsoft 365 (formerly Office 365), elevate Teams into a collaborative work hub.
You can also add Microsoft Power Apps into your Teams environment. Microsoft Power Apps enables you to quickly and easily build and surface custom business applications. These applications can harness your existing business data to gain new insight or power useful functions. Best of all, since everyone is already working in Teams, they have ready access to your new app.
In this set of three articles, we’ll demonstrate how to build a custom Power Apps application. Our application will provide access to product information in SAP without leaving the Teams environment.
You don’t need any previous experience with Power Apps or knowledge of a specific programming language to follow this tutorial. Let’s start by exploring what Power Apps are, setting up the environments, and adding an SAP connector.
What are Power Apps?
Power Apps is a low-code application development environment that enables you to build your applications. It provides many prebuilt services, connectors, and data platforms that connect to your existing business data. Power Apps inside Teams provides the same Power Apps environment, but it’s integrated into Microsoft Teams. This enables you to build and publish applications within Teams.
Power Apps naturally integrate with other Microsoft products, but they also have many ready-to-use connectors to non-Microsoft products. You can potentially use an in-preview SAP connector within your internal SAP environment. But, for this article, we’ll use a sample, open-source Open Data Protocol (OData) connector to connect to SAP’s demo platform so you can follow along.
Apart from setting up the connector to a production or on-premise environment or building your own ODATA connector to any other business system, you would use a similar workflow to make a Power App in Teams. Let’s get started by setting up the SAP demo environment and Power Apps for Teams, then create our first application with connections to SAP.
Setting Up an SAP Demo Environment
Before we set up our Teams and Power Apps environment, we need to set up our demo SAP environment to connect to it later. In this article, we use the SAP Gateway Demo environment that already contains some preloaded data.
To follow along, run through the environment setup (in the SAP tutorial linked above), and you should be able to access the demo SAP Gateway portal. You will see some product-style demo data in there that we will use within our application.
Setting Up a Teams and Power Apps Environment
With our new SAP environment, we’ll also need a Teams and Power Apps environment to create and deploy our application. If you don’t already have access to a Microsoft 365 business account or the business version of Teams, sign up for a one-month free trial. This trial gives you access to all the components we’ll use in this article series. If you do have access to a Microsoft 365 business account, keep in mind that you’ll need to have pretty high access to a Team within Teams and the Power Apps application within your environment to continue.
After enabling and configuring a license, we can add Power Apps into individual Teams using the More Added Apps option within the menu on the left-hand side. From there, we can find Power Apps and Add it to the Team to see the startup screen for building Power Apps applications.
Adding an SAP Connector
Before we create our application, we’ll need to connect to our SAP demo instance using a custom ODATA connector. We use the ODATA connector to minimize the local setup in the cloud demo environment we are using, rather than the demo connector with a more traditional, on-premise SAP environment.
Microsoft’s SAP connector, in preview at the time of this article, enables better connectivity to an on-premise SAP environment. You can use this connector instead of the ODATA connector if you’re building an application using your existing environment or a much broader use case. You can also create a connector to almost any business system through APIs using an OpenAPI definition or a Postman collection.
To set up a new connector to use data within our Teams Power Apps, we need to create one in the Power Automate portal. First, we sign in with our Teams account and select the Teams environment.
Under the Data menu on the left-hand side, we find the Custom Connectors option to build or use a data connection other than the provided ones. We open this option and select the New custom connector drop-down on the top ribbon.
We find several options there, including creating a new connector from scratch or importing an OpenAPI file or Postman collection. In this case, we’ll Import from GitHub.
This option enables us to import the code from Microsoft’s GitHub Repository for Power Platform connectors rather than building a connector from scratch.
First, we select the Custom option and choose the SAP-ODATA-Demo project from the options with a dev branch. After we choose this option, we need to configure the connector. We first specify the SAP instance to connect. The connector will enable us to use a data gateway to connect to an on-premise instance, or, as in our case, we can connect to a cloud SAP host.
To keep it simple, we’ll also leave the custom connector on basic authentication in the next step when logging into our SAP instance. We should instead use either OAuth or an API key to secure access to our SAP instance in a production environment.
The definition step of setting up our connector specifies all the available actions, references, and policies our connection supports. Because this is a predefined connector to our demo instance, we’re limited to the settings already built. But, we can create the request from scratch or import it from Postman for other applications.
SAP has some good documentation for building an OData interface for your specific requirements. Once complete, these requests will be the data interface between SAP and our application.
We have now completed the first setup stage of creating our business application in Teams using Power Apps. Following the steps here, we have configured our environments for use and created a connector to access data from our business system.
We also discussed other options for connecting to SAP and other business systems. You can follow the same process to use these methods.
In the following article, we’ll explore how to retrieve and display our product data from SAP right within Teams. In the third article, we’ll finish up by exploring how to edit some of that data and update SAP accordingly. Let’s now continue to the second article of this series to create our app.