Skip to main content

Notifications

Power Automate - General Discussion
Answered

Chosen options in Teams flow bot transferred to excel

(0) ShareShare
ReportReport
Posted on by 2
I've created post a choice of options as the flow bot to a user in MS Teams. When the end-user has chosen their chosen option and left a comment, I want these responses to be transferred into an excel file. How do I do that?
Categories:
  • Verified answer
    SwatiSTW Profile Picture
    SwatiSTW 311 on at
    Chosen options in Teams flow bot transferred to excel

    Can you try below way, it should help

    • Create a new flow in Power Automate.

    • Choose the trigger "For a selected message" from the Teams connector to start the flow when the bot sends the options.

    • Use the action "Post a choice of options as the Flow bot to a user" (you may already have this set up). Configure the choices and collect comments from the user.

    • Add the action "When a choice response is submitted" (Teams connector). This will capture the user's selection and comment.

    • Add the action "Add a row into a table" from the Excel Online (Business) connector. Note that this step requires you to have a table pre-created in an Excel file stored in OneDrive or SharePoint. The table should have columns for data like "User Response", "Comment", "User Name", etc.

    • Configure the Excel action by specifying the location of the file, the table name, and mapping the columns in Excel to the data captured in previous steps. For example, map the user's response to the "User Response" column and the comment to the "Comment" column.

    • Save and test your flow. When the user submits their response and comment in Teams, the flow will automatically add their input into the Excel file.

    • Example JSON for the "Post a choice of options" action:

      {
      "choices": ["Option 1", "Option 2", "Option 3"],
      "prompt": "Please choose an option and add a comment below."
      }
    • In the Excel action, example mapping might look like:

      • Column "Response" = Dynamic content: "Response"
      • Column "Comment" = Dynamic content: "Comment"
      • Column "User" = Dynamic content: "User Display Name"
    • Save the flow and test it by running the Teams bot. Verify that the Excel file updates correctly after the user submits their response.


      Please mark as answered if my answer helps you 

  • Suggested answer
    miztrz Profile Picture
    miztrz 4 on at
    Chosen options in Teams flow bot transferred to excel
    Hi! There are a couple of ways to achieve this, none of them are straightforward though.
     
    You can use the Excel connector in Power Automate to add data to a workbook. It usually only works well when there is a table you are trying to update, if you already have this set up, that's awesome. 
     
    To update a table in Excel using Power Automate, follow these steps:
    1. Open Power Automate and create or edit a flow.
    2. Search for the “Excel update a row” action or navigate to it under the “Excel Online” connector.
    3. Use the Update a row action to update any of the rows in your table based on a given ID. 

    If you don't have a table to update, or this does not suit your data structure, you can use Power Automate and Office Scripts to achieve pretty much any result needed - little bit of warning, this is easier if you understand JavaScript. If you don't, this part might be a struggle. Still doable but just keep this in mind.
     
    Theres a whole tutorial for this here: Tutorial: Update a spreadsheet from a Power Automate flow - Office Scripts | Microsoft Learn, or if you are more of a videos person, here is a YouTuber blogger guide: 👩‍💻 How to use Office Scripts in Excel & Power Automate.

    I hope that answered your question!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard