Blogs
SAP and Microsoft Teams Integration: How to set up your own Bot
This blog is designed to take you on a technical journey into setting up your own bot with SAP and Microsoft Teams Integration via Copilot Studio.
With my background in engineering, I’ve always been drawn to optimisation and efficiency – so what better way to unite my two passions, engineering and IT, than in one exciting project?
Why? What?
Here’s a simple question for you – what applications do you use the most in your day-to-day job? It’s not a trick question! I’d wager Microsoft Teams and SAP are close to the top of that list…
So, what if it was possible to do some common tasks that you would do in SAP directly from within your Teams chat window? Determined, and having this mission in my mind, I researched further…
This close integration between platforms would’ve been difficult a few years ago, with a developer needing a deep understanding of both systems, as well as excellent coding skills. But, with Microsoft’s Copilot Studio, anyone can create low-code/no-code, useful and scaleable user agents within just a few days.
That’s where we come in, our latest creation is the perfect fusion of Teams and Maextro, allowing you to chat with your own bot and do your day-to-day Maextro tasks from within Teams – streamlining your workflow and saving you time.
Who? Where? When?
Anyone who uses Maextro.
Anywhere, on your laptop, your phone or any device that runs MS Teams.
Anytime, day or night, the bot is ready for you.
How?
Now that we understand the benefits, let’s dive into how this integration is set up.
MS Copilot Studio offers a free trial period, so that you can create your own custom bots and share them with your users, before paying a penny.
This, along with quick prototyping, allows you to create a minimum viable product within a few days/weeks.
The first step is to create your bot, give it a name and logo, a description, instructions and knowledge sources.
Instructions are akin to System Prompts in your traditional LLMs, and variables can be used to further fine-tune the instructions.
Knowledge sources can be used to make the information the bot delivers more granular and contextual to the use case.
So now you’re ready to configure your specific conversation flows in the form of Topics. Topics are just that, specific topics the user can speak to the bot about.
Here, the custom Maextro Main Menu and Create Topic allows the user to choose their main objective, and go from there.
Clicking into a Topic takes you into the Canvas. Now, this looks daunting at first, but it has a specific layout:
- Trigger at the top, as the first node. This can be a phrase-based trigger, or a trigger triggered by the bot.
- The conversation flow, from top to bottom, incorporating questions to the user, generative answers, conditional logic, Power Automate Flows, SAP OData calls, Adaptive Cards and a whole host of other actions.
The trigger for this Topic is intelligent – the bot will trigger this topic based on the user’s intent. You can specify what keywords, or task requests the bot should look out for in a simple textbox.
Now let’s take a closer look at the first step in this flow.
What good is a bot if it cannot interact with the user? For this, Copilot Studio offers the “Ask a Question” action, which can be used to guide the user and the bot towards a specific goal.
Here, the user is asked for three options, and based on the response, either a separate Topic can be called, or the flow can continue.
In this way, you can quickly design the entire flow, and then refine as you test the bot at every stage of development.
One thing to keep in mind, as with all programming, you can create, use, and reuse variables – be that to store user responses, or store the value of a PowerFX formula, or for data manipulation.
Topic variables can be used in a specific Topic, or they can be shared with specific other Topics. Global variables are self-explanatory.
Environment variables are a Power Platform concept. They allow for the basic application lifecycle management (ALM) scenario of moving an app between Power Platform environments.
Take it from me, having a clear variable naming convention will ensure you don’t get a migraine when debugging! The Maextro Main Menu and Create Topic alone has 79 variables so far!
Debugging is easy, you can test the entire flow from the Copilot Studio screen itself, using the Test button in the top right – no need to keep switching between the Studio and Teams.
Above are screenshots of testing both CoPilot Studio and directly in MS Teams.
I hope this blog has given you a starting point to go and explore the tool and its basic functionality. In the next series of blogs, we will take a deep dive into:
- The Power Platform SAP OData connector
- Using Power Automate Flows in Copilot Studio
- Using Adaptive Cards in Copilot Studio for advanced use-cases
- Refining your bot to make it more personal
For more information about our own Maextro Bot, visit Maextro’s page here.
Yash Gokhale
SAP BTP Integration Consultant
Knowledge Bank
Dive into our collection of expert insights, industry guides, and thought leadership pieces. From practical tips to in-depth explorations, our blogs and guides are designed to help you stay ahead in the ever-evolving world of SAP solutions, data management and digital transformation.