🌟 Daily Teams Quiz Bot Tutorial 2025: The Ultimate Guide to Automate Engagement

If you’re looking for a way to bring energy and daily interaction into Microsoft Teams, this guide is exactly what you need. With this Daily Teams Quiz Bot Tutorial 2025, you’ll build a fully automated quiz bot using Power Automate, Adaptive Cards, and the OpenTDB API.

Whether you’re an HR manager, team lead, or just a trivia lover, this solution delivers fun and engagement β€” automatically, every morning at 8β€―AM.


❓ Why Build a Daily Teams Quiz Bot?

Let’s face it β€” team chats can sometimes feel dull. But a fun, daily trivia game using Power Automate can totally change that. This Daily Teams Quiz Bot Tutorial 2025 helps boost morale, create friendly competition, and promote knowledge sharing without writing a single line of code.


πŸ”§ What You Need Before You Begin

To follow this Daily Teams Quiz Bot Tutorial 2025, make sure you have:

  • A Microsoft 365 account with access to Microsoft Teams
  • A Power Automate account: https://make.powerautomate.com
  • An active Teams channel to post the quiz
  • Basic understanding of Power Automate and JSON

βœ… Step-by-Step Guide: Daily Teams Quiz Bot Tutorial 2025

πŸ” Step 1: Create a Scheduled Flow (8β€―AM Daily)

  1. Go to make.powerautomate.com
  2. Select Create > Scheduled Cloud Flow
  3. Name the flow: Daily Teams Quiz Bot
  4. Set the schedule to every day at 8:00β€―AM
power automate recurrence trigger

🟒 This trigger starts your daily quiz flow automatically each morning.


🌐 Step 2: Add HTTP Action to Fetch Questions

Add an HTTP action to fetch quiz data from OpenTDB.

Daily Teams Quiz Bot Tutorial 2025 http action

This fetches 20 medium-difficulty general knowledge questions.

Note: You can customize the API by visiting https://opentdb.com/api_config.php to change the number of questions, category, and other settings as needed.


πŸ“€ Step 3: Parse JSON Response

  • Add a Parse JSON action to your flow.
  • In the Content field:
    • Click inside the field.
    • Then click on the lightning bolt icon (⚑) to open the dynamic content list.
    • Select the Body output from the HTTP action.
  • Next, click on β€œUse sample payload to generate schema.”
    • A pop-up window will appear.
    • Paste the JSON sample (provided below).
{
  "results": [
    {
      "question": "Where did the pineapple plant originate?",
      "correct_answer": "South America",
      "incorrect_answers": [
        "Hawaii",
        "Europe",
        "Asia"
      ]
    }
  ]
}
  • Click Done to automatically generate the schema.
  • The schema will now appear in the text area below the Content field.
power automate parse json

βš™οΈ Step 4: Initialize Variables

Create two variables:

  1. Answers β†’ Array (to hold multiple choice options)
  2. Random number β†’ Integer (to randomize answer position)
initialize variable action

πŸ” Step 5: Loop Through Each Question

Use a For each loop on the results array from the parsed JSON.
In the β€œSelect an output from previous steps” field, choose results from the dynamic content list.

Inside this loop:

  • Add Set Variable action to set Random number to a random index: rand(0,3)
  • Add another Set Variable action to Re-initialize the Answers array to empty
set variable

🧩 Step 6: Add Incorrect and Correct Answers

Inside the same loop:

  1. Use another For each to iterate through incorrect_answers
    • use expression
      • Click on the fx icon, then type the following expression into the text area
        items('For_each')?['incorrect_answers']
      • Alternatively, you can copy and paste it directly using the @ symbol and curly brackets:
        @{items('For_each')?['incorrect_answers']}
  2. Inside the For each action
    • Add an Append to array variable action.
    • In the Name field, select the Answers variable.
    • In the Value field, copy and paste the following JSON using an expression:
{
"title": "@{items('For_each_1')}",
"value": "@{items('For_each_1')}"
}
  1. After the For each loop completes:
    • Add another Append to array variable action.
    • In the Name field, select the same Answers variable.
    • In the Value field, copy and paste this expression to add the correct answer:
{
"title": "@{items('For_each_1')}",
"value": "@{items('For_each_1')}"
}
for each and append to array variable actions

Important Note: If your flow uses “Apply to each” instead of “For each”, make sure to replace For_each with Apply_to_each in your expressions. These names match the exact action names in your flow, but with spaces replaced by underscores.
If you don’t update the name accordingly, the expression will not work correctly.


πŸ”€ Step 7: Shuffle the Answers

Use a Compose action to shuffle the answers array based on the random number:

@{union(
skip(variables('Answers'), variables('Random number')),
take(variables('Answers'), variables('Random number'))
)}
compose action

πŸ’¬ Step 8: Post Adaptive Card to Teams

Use Post adaptive card and wait for a response to show the question.

  • In ‘Post as‘, select the Flow bot.
  • In ‘Post in‘, select Channel.
  • In ‘Message‘, add the following Adaptive Card JSON.
  • In ‘Team‘, select the team’s name.
  • In ‘Channel‘, select the channel’s name.
  • In ‘Update Message‘, add the message that will appear in the channel after the user submits their response.
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Question: @{items('For_each')?['question']}",
"wrap": true
},
{
"type": "Input.ChoiceSet",
"id": "answer",
"style": "expanded",
"choices": @{outputs('Compose')}
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
Post adaptive card and wait for a response

❓ Step 9: Check the User’s Answer

Add a Condition to compare the user’s response:

  • In the ‘Choose a Value’ field, add the following:
  body('Post_adaptive_card_and_wait_for_a_response')?['data/answer']
  • select “is equal to”
  • In the second ‘Choose a Value’ field, add the following:
  items('For_each')?['correct_answer']
condition action

πŸ† Step 10: Update Adaptive Card Based on Result

After checking the condition, add the ‘Update an adaptive card in a chat or channel‘ action to both the True and False branches. This will update the adaptive card in the team’s channel after the user submits their response.

  • If the answer is correct (True branch), the card will be updated with a message indicating the answer is correct.
  • In the False branch, update the red highlighted text in the JSON (shown below) to indicate that the answer is incorrect. Make sure to replace the red text with a message that clearly informs the user their answer was incorrect.
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "πŸŽ‰ This question has been answered correctly by @{body('Post_adaptive_card_and_wait_for_a_response')?['responder/displayName']}!",
"wrap": true
},
{
"type": "TextBlock",
"text": "Question: @{items('For_each')?['question']}",
"wrap": true
},
{
"type": "TextBlock",
"text": "Correct answer: @{body('Post_adaptive_card_and_wait_for_a_response')?['data/answer']}",
"wrap": true
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
Update an adaptive card in a chat or channel

πŸ“˜ Key Flow Components Explained

  • Trigger: Starts the flow daily at 8:00 AM using the Recurrence trigger to deliver the quiz consistently every morning.
  • HTTP: Fetches fresh trivia questions from the Open Trivia Database (OpenTDB) API.
  • Parse JSON: Extracts question details and answers from the API response for use in the flow.
  • Apply to each: Processes each quiz question individually to generate adaptive cards and handle user responses.
  • Adaptive Card: Sends an interactive card to Teams displaying the question and answer choices.
  • Condition: Checks if the user’s answer is correct and branches the flow accordingly.
  • Update Card: Updates the adaptive card in Teams to show whether the user’s answer was right or wrong, providing immediate feedback.

πŸ“Š Final Thoughts on Your Daily Teams Quiz Bot Tutorial 2025

Using this Daily Teams Quiz Bot Tutorial 2025, you’ve created an engaging, automated trivia system that runs itself every day. It’s a low-maintenance, high-reward tool for team culture, learning, and fun.

You can enhance this bot further by:

  • Storing results in SharePoint
  • Creating a leaderboard
  • Adding categories and score tracking

πŸ“Š Want to Use Excel for Questions and Answers? β€” Daily Teams Quiz Bot Tutorial 2025

Would you prefer to manage your quiz questions and answers using an Excel file instead of the OpenTDB API? Using Excel makes it easy to update your quiz content without coding, and you can also save winners directly in the Excel sheet πŸ† to announce the overall winner at the end of the quiz.

Plus, using Excel does not require a premium license in Power Automate πŸš«πŸ’³, unlike the HTTP action that fetches trivia from OpenTDB, which is a premium connector βš™οΈ.

If you’re interested in a version like this, please let me know in the comments below! πŸ’¬ I’ll create a Tutorial Version 2 using the same flow but with Excel integration if there’s enough demand.


πŸ’‘ Bonus Resources


Leave a Comment