SAP & Teams Integration with Copilot Studio and Generative AI (2024)

In this blog, we provide a detailed guide on leveraging AI to optimize SAP workflows within Microsoft Teams. This solution is particularly advantageous for mobile users or those with limited SAP experience, enabling them to efficiently manage even complex, repetitive SAP tasks.

By integrating SAP with Microsoft Teams using Copilot Studio and Generative AI, we can significantly enhance productivity and streamline workflows. This blog will take you through the entire process of setting up a Copilot to interact with SAP data in Teams. We'll utilize the Power Platform and SAP OData Connector to achieve this integration. By following along you will create and configure a Copilot, test and deploy it within Teams, enable Generative AI, build automation flows, and create adaptive cards for dynamic data representation and even change data in SAP.

The solution consists of three main components: Copilot Studio, Power Automate Flow and SAP OData Connector.

  • Copilot Studio is a web-based tool that allows you to create and manage conversational AI agents, called Copilots, that can interact with users through Microsoft Teams.
  • Power Automate Flow is a is a tool that allows you to automate workflows between your applications.
  • SAP OData Connector is a custom connector that enables you to connect to SAP systems using the OData protocol.

The following diagram illustrates how these components work together to provide a seamless SAP and Teams integration experience.

SAP & Teams Integration with Copilot Studio and Generative AI (1)

Before you start building your Copilot, you need to make sure that you have access to the Power Platform and to an SAP system. You can leverage the licenses and SAP systems that are available in your company, or alternatively you can use a trial license for the Power Platform and a public SAP demo system. The following links will guide you on how to obtain these resources if you don't have them already.

2.1. Power Platform Access

Trial license:https://learn.microsoft.com/en-us/power-apps/maker/signup-for-powerapps

2.2. SAP System Access

Request SAP Gateway Demo System ES5 Login:https://developers.sap.com/tutorials/gateway-demo-signup.html

Now that you have an overview of the solution and have ensured you meet the prerequisites, it's time to dive into the hands-on process of creating a Copilot. This section will guide you through the detailed steps to set up and configure your Copilot, enabling it to interact with SAP data within Microsoft Teams. You'll learn how to leverage Power Automate Flow and the SAP OData Connector to build a robust automated workflow. By the end of this chapter, you will have a fully functional Copilot that can retrieve information about products from the SAP system.

3.1. Create a Copilot

Create a Copilot with the name “SAP Product Copilot”:

SAP & Teams Integration with Copilot Studio and Generative AI (2)

And enter the following details:

SAP & Teams Integration with Copilot Studio and Generative AI (3)

Activate “Generative AI” Feature in the Settings of the Copilot

SAP & Teams Integration with Copilot Studio and Generative AI (4)

SAP & Teams Integration with Copilot Studio and Generative AI (5)

3.2. Setup Flow + Connector

Create a new “Instant cloud flow” in Power Automate:

SAP & Teams Integration with Copilot Studio and Generative AI (6)

Provide the name and chose “Run a flow from Copilot” as trigger:

SAP & Teams Integration with Copilot Studio and Generative AI (7)

Add an input variable to the trigger action:

SAP & Teams Integration with Copilot Studio and Generative AI (8)

Add an SAP OData action. Choose Query OData entities:

SAP & Teams Integration with Copilot Studio and Generative AI (9)

Configure the connection:

SAP & Teams Integration with Copilot Studio and Generative AI (10)

OData Base URI: https://sapes5.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC

Enter the OData Entity “Product Set”:

SAP & Teams Integration with Copilot Studio and Generative AI (11)

Presse “Show all” to enter a filter in the advanced parameters:

SAP & Teams Integration with Copilot Studio and Generative AI (12)

In $Filter you’ll enter a Power FX expression that will filter on the provided Category.

SAP & Teams Integration with Copilot Studio and Generative AI (13)

Add this expression:

concat('Categoryeq','''',triggerBody()['text'],'''')

Add a final action that will return the found products.

SAP & Teams Integration with Copilot Studio and Generative AI (14)

Find the required action by searching for Copilot

SAP & Teams Integration with Copilot Studio and Generative AI (15)

Add an output variable

SAP & Teams Integration with Copilot Studio and Generative AI (16)

In the output add a Power FX expression:

SAP & Teams Integration with Copilot Studio and Generative AI (17)

body('Query_OData_entities')

Finally, the action should look like this:

SAP & Teams Integration with Copilot Studio and Generative AI (18)

3.3. Test the flow

Choose Manually and enter the category “Keyboards”:

SAP & Teams Integration with Copilot Studio and Generative AI (19)

The successful run will indicate that the flow and the connector work fine.

SAP & Teams Integration with Copilot Studio and Generative AI (20)

3.4. Connect the Copilot with the Flow.

Add an action:

SAP & Teams Integration with Copilot Studio and Generative AI (21)

Chose the previously created Flow:

SAP & Teams Integration with Copilot Studio and Generative AI (22)

Next:

SAP & Teams Integration with Copilot Studio and Generative AI (23)

Edit the Input:

SAP & Teams Integration with Copilot Studio and Generative AI (24)

And add the following text into the Description. This ensures Gen AI knows how to set the input for the flow:

Product Category. Only one single category can be chosen as input from this list. It is case-sensitive and must be written exactly like below:

Accessories,

Notebooks,

Laser Printers,

Mice,

Keyboards,

Mousepads,

Scanners,

Speakers,

Headsets,

Software,

PCs,

Smartphones,

Tablets,

Servers,

Projectors,

MP3 Players,

Camcorders

Edit the Description of the action output in the same way:

Products found in SAP of a given category.

Present the result as HTML table including following information: ProductID; Name; Category; Description; Supplier; Price; Currency.

3.5. Test the Copilot in the test pane

Open the Test pane and give it a try:

SAP & Teams Integration with Copilot Studio and Generative AI (25)

For the first test you need to connect with the SAP OData Connector:

SAP & Teams Integration with Copilot Studio and Generative AI (26)

Now you should get the response in the chat window:

SAP & Teams Integration with Copilot Studio and Generative AI (27)

3.6. Add the Copilot to Teams

Publish the Copilot first:

SAP & Teams Integration with Copilot Studio and Generative AI (28)

SAP & Teams Integration with Copilot Studio and Generative AI (29)

Then connect to Teams in the Channels Tab:

SAP & Teams Integration with Copilot Studio and Generative AI (30)

SAP & Teams Integration with Copilot Studio and Generative AI (31)

Open the Copilot in Teams

SAP & Teams Integration with Copilot Studio and Generative AI (32)

Finally test the Copilot in MS Teams

SAP & Teams Integration with Copilot Studio and Generative AI (33)

You have successfully built a Copilot that can retrieve up-to-date information of products stored in an SAP system and present it in a table format in Microsoft Teams.

Now let’s move on by creating adaptive cards to display SAP data dynamically within Microsoft Teams. In this section you will

  • Create and configure topics.
  • Activate topics using the appropriate trigger phrases.
  • Call flows from within topics.
  • Utilize various entities of the SAP OData Connector.
  • Handle special situations, such as when no product is found.
  • Parse JSON data and assign values to topic variables.
  • Design and implement adaptive cards.
  • Understand the differences between actions and topics.

By mastering these skills, you will enhance the functionality and interactivity of your Copilot, providing users with a more intuitive and efficient way to interact with SAP data.

4.1. Create a Topic “SAP Product Data”

Create a new topic from blank

SAP & Teams Integration with Copilot Studio and Generative AI (34)

In the section “Describe what the topic does” Enter the following:

You can copy/paste this description:

This tool can handle queries like these:

sap product update.

Update SAP product.

Update SAP product data.

Edit product information in SAP.

Edit SAP product data.

Show SAP product details.

Edit SAP product information.

Save the Topic

SAP & Teams Integration with Copilot Studio and Generative AI (35)

Open the Topic Details and add the Description

SAP & Teams Integration with Copilot Studio and Generative AI (36)

Description: “Show and update information about a product in the SAP system.”

Create the Input variable

SAP & Teams Integration with Copilot Studio and Generative AI (37)

Save again.

Add a node that asks for the Product ID.

Question:

Which product do you want to update?

Please provide the Product ID.

Example: HT-1000.

SAP & Teams Integration with Copilot Studio and Generative AI (38)

In the Identify field choose “User’s entire response”:

SAP & Teams Integration with Copilot Studio and Generative AI (39)

Make sure the response will be saved in the variable ProductID:

SAP & Teams Integration with Copilot Studio and Generative AI (40)

Note: With GenAI feature enabled the question might not be asked when the ProductID is already known within the context of the conversation, which is very convenient.

Add a Message that will help us to verify if up to here the topic works as designed:

SAP & Teams Integration with Copilot Studio and Generative AI (41)

This message can be removed later when all is working fine.

4.2. Create a Flow to get SAP product details

Take the flow from Lab1 and make a copy

SAP & Teams Integration with Copilot Studio and Generative AI (42)

SAP & Teams Integration with Copilot Studio and Generative AI (43)

Refresh the page to see the new flow and then turn the flow on

SAP & Teams Integration with Copilot Studio and Generative AI (44)

Change the Filter in the new Flow

SAP & Teams Integration with Copilot Studio and Generative AI (45)

The new filter must be changed to filter on ProductID:

concat('ProductID eq ', '''', triggerBody()['text'], '''')

Then update the action and save the flow.

4.3. Call the Flow from the Topic

Add a node “Call Action” and choose the “List SAP product details” flow:

SAP & Teams Integration with Copilot Studio and Generative AI (46)

As Input provide the ProductID variable:

SAP & Teams Integration with Copilot Studio and Generative AI (47)

Save again.

4.4. Add error handling when no data is found

Add some error handling in case we got the ProductID wrong, and nothing was found in SAP:

SAP & Teams Integration with Copilot Studio and Generative AI (48)

Steps are:

  • Set a condition where Output is equal to “[]” which means no product was found and an empty JSON string was returned.
  • Send a message to inform the user: “The product with ID “ProductID” was not found.”
  • Add a route via “Topic Management” -> “Got to step” and select the destination step where the topic asks for the Product ID.
SAP & Teams Integration with Copilot Studio and Generative AI (49)SAP & Teams Integration with Copilot Studio and Generative AI (50)

Save again.

4.5. “Parse value” the Flow Output

The flow returns a JSON elopement that contains all product details. These must be parsed and assigned to a Table variable.

SAP & Teams Integration with Copilot Studio and Generative AI (51)

Select the Output from the Flow as Input.

SAP & Teams Integration with Copilot Studio and Generative AI (52)

As data type pick “From sample data”

SAP & Teams Integration with Copilot Studio and Generative AI (53)

Get the sample data from a flow test run with a known Product ID

SAP & Teams Integration with Copilot Studio and Generative AI (54)

You can copy/paste the sample data from the successful flow run. Either get it in the output of respond to copilot or take it from the Odata query output

SAP & Teams Integration with Copilot Studio and Generative AI (55)SAP & Teams Integration with Copilot Studio and Generative AI (56)

Enter the sample data to create the schema

SAP & Teams Integration with Copilot Studio and Generative AI (57)

SAP & Teams Integration with Copilot Studio and Generative AI (58)

Save the result into a new variable called Product.

SAP & Teams Integration with Copilot Studio and Generative AI (59)

4.6. Adaptive Card with SAP Data

Create a Send message node

SAP & Teams Integration with Copilot Studio and Generative AI (60)

Send the message as adaptive card

SAP & Teams Integration with Copilot Studio and Generative AI (61)

Enter the following draft adaptive card JSON to start with:

https://techcommunity.microsoft.com/gxcuf89792/attachments/gxcuf89792/SAPApplications/1042.22/1/sap_...

The card will look like this:

SAP & Teams Integration with Copilot Studio and Generative AI (62)

As a next step make the adaptive card dynamically showing the values from the Product Table. For this you must switch to Formula:

SAP & Teams Integration with Copilot Studio and Generative AI (63)

This will change the format slightly removing all the double quotes of the variable names.

Edit the last Entry from

"text": "${Topic.ProductID}"

To:

text: Topic.ProductID

Save and test again. Now you have an adaptive card showing dynamically a value returned by the flow:

SAP & Teams Integration with Copilot Studio and Generative AI (64)

As a next step add the full code from the link below to show all the SAP information in the adaptive card:

https://techcommunity.microsoft.com/gxcuf89792/attachments/gxcuf89792/SAPApplications/1042.22/2/sap_...

Note: You can create your own design and adaptive cards JSON code here: https://adaptivecards.io/designer/

Save and run another test:

SAP & Teams Integration with Copilot Studio and Generative AI (65)

To advance the copilot capabilities even further, you can enable changing product information in SAP. Therefore, the following steps must be done:

  • Initiate actions from adaptive cards by using the “Ask with adaptive card” node.
  • Create another flow to update data and use the update entity in the SAP OData connector.
  • Configure more additional variables handling in the topic
  • Update the Copilot to use the “update” flow.

5.1. Add “Ask with adaptive card” Node

Add a node “Ask with adaptive card”

See also:

Ask with Adaptive Cards - Microsoft Copilot Studio | Microsoft Learn
SAP & Teams Integration with Copilot Studio and Generative AI (66)

Take the code from the previously created adaptive card.

Add the action “Submit” at the end of the AC code.

,

actions: [

{

type: "Action.Submit",

title: "Submit Changes",

horizontalAlignment: "Center",

data: {

action: "submitProductChanges"

}

}

]

Save this adaptive card.

Delete the previously created AC as we don’t need it any longer.
SAP & Teams Integration with Copilot Studio and Generative AI (67)

When you get the error about missing properties, meaning the Adaptive Card editor did not automatically create the output structure you need to edit the schema manually.

Edit schema on the bottom right.

SAP & Teams Integration with Copilot Studio and Generative AI (68)

Enter the variable types into the schema binding:

kind: Record

properties:

action: String

actionSubmitId: String

currencyCode: String

description: String

price: Number

productName: String

SAP & Teams Integration with Copilot Studio and Generative AI (69)

Confirm this, save the topic and test again

SAP & Teams Integration with Copilot Studio and Generative AI (70)

5.2. Create “Update SAP Product Details” Flow

The final step is to run another flow that will update the product information in SAP.

Create another flow with the same copy procedure as before.

SAP & Teams Integration with Copilot Studio and Generative AI (71)

Refresh the page and “Turn on” the flow.

SAP & Teams Integration with Copilot Studio and Generative AI (72)

At second position add an action “SAP OData Connector” with the Entity “Update OData entity”.

Set the ProductID Input as shown:

SAP & Teams Integration with Copilot Studio and Generative AI (73)

In the advanced parameters mark those where we want to allow updates. These are Name, Description, Price and CurrencyCode:

SAP & Teams Integration with Copilot Studio and Generative AI (74)

Add the additionally required Flow Parameters. (Note: Price is a number):

SAP & Teams Integration with Copilot Studio and Generative AI (75)

Update the “Update Odata entity” Actions with the relevant variables in the corresponding fields:

SAP & Teams Integration with Copilot Studio and Generative AI (76)

Update the last action in the flow with the success message:

SAP & Teams Integration with Copilot Studio and Generative AI (77)

5.3. Update the Copilot Topic to call the update flow

After the adaptive card node add the node “Call an action” and pick the “Update SAP product detail” flow:

SAP & Teams Integration with Copilot Studio and Generative AI (78)

Open the “variable” pane and activate the required variables.

SAP & Teams Integration with Copilot Studio and Generative AI (79)

Fill in the variables in the respective input fields.

SAP & Teams Integration with Copilot Studio and Generative AI (80)

The last step is to send the message about the successful product information update:

SAP & Teams Integration with Copilot Studio and Generative AI (81)

Save and test in the copilot test pane.

SAP & Teams Integration with Copilot Studio and Generative AI (82)

When all works fine you can publish again and test the functionality in MS Teams. You’ll need to trigger the Copilot update in MS Teams with the “Start over” trigger phrase.

SAP & Teams Integration with Copilot Studio and Generative AI (83)

We hope you enjoyed following along this blog and that you will find it useful for your own SAP projects.

With the steps outlined in this blog, you are now equipped to fully leverage the integration of SAP with Microsoft Teams using Copilot Studio and Generative AI. You can use any available SAP OData service or even create your own, enabling seamless access and management of SAP data within Teams. This integration not only simplifies workflows but also transforms simple, repetitive tasks into significant value-adding activities for users.

You can enable even those users with little or no SAP know-how to complete SAP-specific tasks, thanks to the built-in Generative AI feature that can always help and answer every question. As you explore and implement these capabilities, you'll discover new opportunities to enhance productivity and drive innovation in your SAP related digital workspace.

The future of integrated, AI-powered collaboration is here, and it hopefully starts with your next SAP and Teams integration scenario.

sap_product_adaptive_card.zip

SAP & Teams Integration with Copilot Studio and Generative AI (2024)

References

Top Articles
Powerschool Cedar Falls
All 32 Nancy Drew Video Games, Ranked From Worst To Best
Target Dummies 101 - The Dummy Research/Tutorial Thread
Futuretechgirls Contact
Local Dog Boarding Kennels Near Me
Poochies Liquor Store
Ups Cc Center
Lesson 10 Homework 5.3
Jonesboro Sun News
Icy Veins Necromancer Diablo 4
M3Gan Showtimes Near Regal City North
Hotleak.vip
Ofw Pinoy Channel Su
Th 8 Best Army
9:00 A.m. Cdt
Taxi Driver Kdrama Dramacool
Uga Im Leagues
Lehigh Valley Ironpigs Score
Kamala Harris, Donald Trump debate prompts major endorsem*nt, Fox News invitation for a 2nd face-off
Names of the dead: September 11, 2001
Elanco Rebates.com 2022
Soul of the Brine King PoE Pantheon 3.14 Upgrade
Solid Red Light Litter Robot 4
The Legend of Zelda: Every Reincarnation of Princess Zelda Explained
Walmart Supercenter Nearest To My Location
Emojiology: 🤡 Clown Face
SF bay area cars & trucks "chevrolet 50" - craigslist
Erj Phone Number
Cia Decrypter
Eros Cherry Hill
Yillian Atkinson Velez
Exploring The Craigslist Washington DC Marketplace - A Complete Overview
Shannon Sharpe Pointing Gif
Https //Paperlesspay.talx.com/Gpi
Wolf Of Wallstreet 123 Movies
Rare Rides: The 1970 Chevrolet Chevelle SS454 LS6 Convertible - Street Muscle Rare Rides
Babymukki
Längen umrechnen • m in mm, km in cm
Cars for Sale by Owner in San Francisco, CA
DePaul joins nationwide pro-Palestinian college protests as encampment continues at University of Chicago
Grayson County Craigslist
Every Act That's Auditioned for AGT Season 18 So Far
Flixtor The Meg
The Stock Exchange Kamas
1 Filmy4Wap In
Cetaphil Samples For Providers
Mnps Payroll Calendar 2022-23
Kayla Simmons Of Leak
Registrar Lls
4215 Tapper Rd Norton Oh 44203
Craigslist Sf Jobs Food And Beverage
Craigslist Org Las Vegas Cars
Latest Posts
Article information

Author: Lilliana Bartoletti

Last Updated:

Views: 6502

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Lilliana Bartoletti

Birthday: 1999-11-18

Address: 58866 Tricia Spurs, North Melvinberg, HI 91346-3774

Phone: +50616620367928

Job: Real-Estate Liaison

Hobby: Graffiti, Astronomy, Handball, Magic, Origami, Fashion, Foreign language learning

Introduction: My name is Lilliana Bartoletti, I am a adventurous, pleasant, shiny, beautiful, handsome, zealous, tasty person who loves writing and wants to share my knowledge and understanding with you.