Loading
Loading
  • Home

  • Automation with Zapier

  • Zapier tutorials

Zapier tutorials

6 min read

How to create an auto-responder (and other bots) in Microsoft Teams

By Krystina Martinez · February 19, 2024
Hero image for a Zapier tutorial with the Microsoft Teams and Zapier logos connected by dots

Team chat apps are great for one-off communication with your coworkers and it's much faster than email. But when you're getting the same questions over and over in chat, or need to make sure your team is up-to-date on information from other apps, you need help from a bot.

Quite simply, bots run automated tasks online. There are many different types, but for the purpose of this article, we're going to talk about chatbots—bots that run automated tasks in chat apps—and specifically, how to create them for Microsoft Teams.

There are a variety of pre-made bots available in Microsoft Teams, and you can also create a Teams bot from scratch. But if you can't find a ready-made bot and you don't know how to code, there's a third option: Zapier.

With Zapier's automated workflows, there are two types of bots you can build:

  • Auto-responder bots will respond when someone mentions another user or uses a specific phrase in Microsoft Teams. These are great for when a person is out of office, or answering questions that often come up in chat.

  • Notification bots watch what's happening in other apps and send any updates to Microsoft Teams, eliminating the need to toggle between different apps. Tired of toggling windows to check on Salesforce leads? A notification bot will be your friend.

We'll walk you through how to create an auto-responder bot using Zapier. And we'll even show you how to add AI into the mix to personalize the response each time. Here's how.

If you're interested in setting up a notification bot, check out our tutorial on building Zaps in Microsoft Teams.

How to create an auto-responder in Microsoft Teams

Whenever you're on vacation, it can be annoying (and anxiety-inducing) to return to a million alerts and unread messages in chat. Or maybe you get tired of copying-and-pasting the same form to order office supplies whenever a team member asks about it.

With an auto-responder bot, it will watch Microsoft Team channels for specific mentions or phrases. Whenever someone says those magic words, the bot will automatically reply with a message.

Here's how to set it up:

  1. Install the Zapier app in your Microsoft Teams workspace (and make sure to sign up for a Zapier account if you haven't already)

  2. Click the button below to use our template.

  3. Connect Microsoft Teams and choose your auto-responder trigger

  4. Customize the message you want to send

  5. Test your Zap and turn it on!

We'll be working from a Zap Template—what we call our pre-made automated workflows—for this tutorial.

Send auto-reply messages in Microsoft Teams for new mentions in Teams

Send auto-reply messages in Microsoft Teams for new mentions in Teams
  • Microsoft Teams logo
  • Microsoft Teams logo
Microsoft Teams

Before you begin

Make sure you've installed the Zapier app in your Microsoft Teams workspace. If you don't have a Zapier account, don't forget to sign up too. (It's free to start!) Not only will you be able to create automated workflows with Teams, but you'll also be able to do so without leaving the app.

Connect Microsoft Teams and customize your trigger

Click on the template above, which will take you directly to the Zap Editor to begin creating your Zap. If you're starting from scratch, search for and select Microsoft Teams for the trigger app and New Channel Mention for the trigger event, then click Continue.

An Event dropdown in a Zap trigger step with New Channel Message highlighted with an orange square.

Next, connect your Microsoft Teams account. If you've already connected Teams to Zapier before, just click on the dropdown menu to select your account. Otherwise, click +Connect a New Account to connect your workspace. Once you've selected your account, click Continue.

If you're building your Zap from the Microsoft Teams app and you're connecting your Teams account for the first time, Zapier will redirect you through your web browser. Once you've authorized Zapier to access your workspace, you can continue building your Zap from your web browser—or go back to the Microsoft Teams app and continue where you left off. You won't lose any progress.

A selected Microsoft Teams account in the Zap editor.

Next, we'll customize how you want your auto-responder to trigger. Under Team, select your workspace from the dropdown menu. Under Channel, select which channel you want your auto-responder to trigger.

A trigger step in the Zap editor with fields to customize a Microsoft Teams step.

If you want your auto-responder to trigger if someone says a specific phrase (e.g. "YubiKey order"), type in your word or phrase in the Highlight Word field. If you want your auto-responder to trigger if someone @ mentions a specific user, select the user from the dropdown menu.

In this example, we want to create an out-of-office bot, so we're going to select a specific user. When you're done, click Continue.

Note: Filling in both Highlighted Word and Member means your bot will trigger whenever someone @ mentions a specific user AND uses the key phrase. Both conditions have to occur for the Zap to trigger.

The Member field dropdown with Will Harris selected from the available options.

Now it's time to test our trigger. Zapier will find the most recent mention, according to the criteria we set in the previous step. Zapier will use this test information in later steps to build the rest of our Zap. Click Test trigger.

A test step in the Zap editor, testing the Microsoft Teams trigger step.

If your test information looks correct, go ahead and click Continue with selected record. If something doesn't look right, go back to the previous step to adjust your settings. If Zapier can't find anything, send a test message in your Teams channel with the specific mention and re-test.

A selected test record showing a Microsoft Teams posting.

Customize your auto-responder message

If you're working from the template, the action app and event will be pre-selected for you. If you're starting from a blank slate, search for and select Microsoft Teams for the action app and Send Channel Message as the action event, then click Continue.

An action step in the Zap editor with Microsoft Teams selected for the action app and Send Channel Message selected for the action event.

Select your Microsoft Teams account from the dropdown menu and click Continue.

A selected Microsoft Teams account in the Zap editor.

Next, select your Microsoft Teams workspace under Team. In the Channel field, select the channel you'd like your message to appear—it should be the same channel your mention came from.

Since we're creating a vacation responder bot, we want to include a link to our out-of-office doc so our teammates can fill us in on anything we missed, Under Message Text Format, click on the dropdown menu and select Markdown. If you don't need to include any special formatting in your message, such as bolded text or hyperlinks, Plain is also fine.

Markdown is a formatting language that's simpler to write and read than HTML code. New to Markdown? Check out our guide.

A dropdown for the Message Text Format field with "markdown" selected in the dropdown.

In the Message Text field, type out the message you'd like your Zap to send. In this example, I used Markdown to link to my out-of-office doc.

The Message Text field in a Microsoft Teams Zap that shows an out of office message.

When you're done formatting your message, click Continue.

Need more help easing back to work after a vacation? Check out our automation tips.

Test your Zap

Now it's time to test our Zap. Click Test step and Zapier will send a new message using our instructions from the previous step.

A test in the Zap editor that shows a successful Microsoft Teams message.

If something doesn't look right, you can go back, make changes, and re-test your Zap. Once everything is set up correctly, you're ready to begin using your Zap.

If you made an auto-responder bot to handle common questions, you can leave your Zap on. Since this is a vacation autoresponder, you'll want to turn off your Zap when you're working and turn it on when you are actually out of the office.

If you want to get a little more advanced, try adding extra steps to your Zap—for example, looking up your work calendar for vacation time before sending your vacation message—so you don't have to remember to turn your Zap on or off.

Now you've created your own auto-responder bot in Microsoft Teams!

An out of office message in Microsoft Teams.

Create an AI auto-responder in Microsoft Teams

If you want to create a simple, static auto-responder in Microsoft Teams, the instructions above will do the trick. Or, you can add AI into the mix and let your bot respond differently based on the message you receive. And it only takes one extra step.

Multi-step Zaps—available on our paid plans—allow you to add multiple actions, filters, and even branching logic so you can do more, automatically. Learn how to use multi-step Zaps.

Add AI to your Microsoft Teams auto-responder

Before you get started, you need to set up an OpenAI account. Once you've opened your account, Go to API Keys in the left sidebar.

The API Keys menu in an OpenAI account.

Next, click + Create new secret key to generate a new API key. Be sure to copy the key once you're done, as you'll need it to connect your account to Zapier.

Now, to start your Zap. The trigger step is going to be the exact same as the Zap above. But instead of  selecting Microsoft Teams for your first action step, select ChatGPT for the action app and Conversation for the action event.

A trigger step in the Zap editor with ChatGPT selected for the trigger app and Conversation selected for the trigger event.

Click Continue.

Next, either select your ChatGPT account from the dropdown menu or click + Connect a new account. To connect your account, paste the secret key you copied earlier into this field when the pop-up appears.

A pop-up asking for permission for Zapier to access your ChatGPT account.

Click Yes, Continue to ChatGPT.

Now, in the User Message field, select Body Content from the Insert data dropdown. This will pull in the message from Microsoft Teams, and send it to ChatGPT to respond to.

A dropdown for the User Message field with Body Content selected in the dropdown menu.

Then, in the Assistant Instructions field, tell ChatGPT how you'd like it to respond to the message. You can give notes on tone, voice, or even leave specific instructions based on the sender of the message. Feel free to get creative here.

The Assistant Instructions field with directions for how to respond to requests when the user is out of office.

If you want, further customize your message by giving your assistant a name or by adjusting the temperature (creativity). None of that is necessary for this workflow, however.

Click Continue when you're done customizing your prompt.

Then, click Test step to test your step and have Zapier send the prompt to ChatGPT.

A test step in the Zap editor for a ChatGPT response.

If everything looks good, click the + button at the bottom of your screen to add one more action step.

The setup for this third step is going to be the exact same as the one you used to post to Microsoft Teams before—with Microsoft Teams as the action app and Send Channel Message as the action event.

The only difference is, instead of typing out your message in the Message Text field, select Reply from the ChatGPT action step section in the Insert Data dropdown.

The Message Text field in the Zap editor with the ChatGPT Reply selected from the field's dropdown.

Now, instead of replying with the same, static response, your bot will use ChatGPT to automatically generate and respond with unique replies for each message you receive.

An out of office response in Microsoft Teams.

This article was originally published in October 2020. It was most recently updated in February 2024 by Will Harris.

Get productivity tips delivered straight to your inbox

We’ll email you 1-3 times per week—and never share your information.

tags
mentioned apps

Related articles

Improve your productivity automatically. Use Zapier to get your apps working together.

Sign up
A Zap with the trigger 'When I get a new lead from Facebook,' and the action 'Notify my team in Slack'