Skip to main content

Notifications

Copilot Studio - General
Unanswered

Post message in Microsoft Teams Team Channel as bot

Posted on by 16

I am reaching out because I need some assistance with a ChatBot that I created using power virtual agents in Microsoft as well as Power Automate. Basically what I'm trying to do is post in my teams Channel for my team from the answers to the questions our chatbot asks.

 

As of right now the answers to the questions are coming to an email mailbox that I created using Microsoft Flow and Power automate. There's no issue there using power automate to the email I created. However, when I want to post in a team’s channel or chat using Microsoft Flows I want it to post as the new mailbox user I created not as myself. I created a Generic Mailbox and I'm wondering if I should put in a request to get a new AD user created for the bot so it can post as itself instead of me the creator.

Not sure if anyone can help or has done this before, please let me know if anyone can help.

  • DiegoPeres Profile Picture
    DiegoPeres 327 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    Hi @Derricki87  

    If you want it to be sent with a custom name, this is really the way to go.
    I am happy to have contributed.


    Did I answer your question?😉
    Please consider accepting it as the solution to help other members find you faster.


    Like my answer?


    Like it! 👍



    Thanks!
    Diego Peres,
    Connect with me: Linkedin

     

  • Derricki87 Profile Picture
    Derricki87 16 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    @DiegoPeres thank you sir that's exactly what I figured was the issue. My thought to fix this is to get an AD user created for the Teams connector so it posts as the bot user. 

  • DiegoPeres Profile Picture
    DiegoPeres 327 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    Hi @Derricki87 
    And exactly that,

    User: Use your account to post directly on your name, or on the connector's configured name

    Bot Flow: Send using a PA conversation, on behalf of who the connector is configured for (I usually use this one)

    PVA Preview: Posts like the chatbot, but it's only available for direct user conversation, i.e. it's not possible to send to a channel.


    Did I answer your question?😉
    Please consider accepting it as the solution to help other members find you faster.


    Like my answer?


    Like it! 👍



    Thanks!
    Diego Peres,
    Connect with me: Linkedin

     

  • Derricki87 Profile Picture
    Derricki87 16 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    @DiegoPeres 

     

    Thank you for all of your help, I've looked at your screenshots, but not sure what to choose as the user. I've been using "User" but the only options I have are below:
    Post.JPG
    Which if I choose User it posts as me no matter what, if I choose Flow Bot it posts as me using Power automate and the Power Virtual Agents (Preview) Only offers the Chat with Bot option or Custom.

  • DiegoPeres Profile Picture
    DiegoPeres 327 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    You must select the option to send as bot user, choose the channel you want to post to, "the user used in the connector must have access to the TEAMS channel", then return null to the bot.
    If any error occurs return here with a printout of the error;


    Did I answer your question?😉
    Please consider accepting it as the solution to help other members find you faster.


    Like my answer?


    Like it! 👍



    Thanks!
    Diego Peres,
    Connect with me: Linkedin

     

  • DiegoPeres Profile Picture
    DiegoPeres 327 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    @Derricki87 
    I built a fast flow here, look at the result.

    DiegoPeres_10-1661821372446.png

    DiegoPeres_11-1661821447815.png

     


    sending by bot to a user

    DiegoPeres_3-1661820551373.png

    DiegoPeres_9-1661821321289.png

     

     

    DiegoPeres_7-1661821228625.png

     

     

    sending by my user to a channel

    DiegoPeres_6-1661821206632.png

     

    DiegoPeres_5-1661821157390.png

    DiegoPeres_8-1661821292757.png

     

  • Derricki87 Profile Picture
    Derricki87 16 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    Hello @DiegoPeres 

     

    In case you have to post the message on Teams in whose name? - It posts as my name in the Teams Channel

    Would it be the name of the user who replied in the chatbot? - I want it to post as the bot (that would be nice if I could get the bot to post it from the user who replied to the chatbot. I just didn't think that was an option.)

    Would it be on behalf of the BOT? - It would be from the users responses and it would post in the channel from the bot itself.

    Or a service user? - No service user although I'm starting to lean towards asking an AD user to be created with Microsoft Team permissions so it can post in the channel. Although I've configured the sub-channel in teams to allow bots to post to the channel.

     

  • DiegoPeres Profile Picture
    DiegoPeres 327 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    In case you have to post the message on Teams in whose name?

    Would it be the name of the user who replied in the chatbot?

    Would it be on behalf of the BOT?

    Or a service user?

  • Derricki87 Profile Picture
    Derricki87 16 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    Hello @DiegoPeres 

    Just an FYI, I'm doing it within the Microsoft Teams > Power Virtual Agents > chatbot > Topics > The Topic I created > Then I asked the questions > then it's set to send an email Below is my flow:

    Power Virtual Agents > Send an email (V2) > Post a message in a chat or channel

    FlowFlowPower Virtual AgentPower Virtual AgentSend an email (V2)Send an email (V2)Post a message in a chat or channelPost a message in a chat or channel

  • DiegoPeres Profile Picture
    DiegoPeres 327 on at
    Re: Post message in Microsoft Teams Team Channel as bot

    Hi @Derricki87

     Could you send me a printout of your flow, I will simulate it here in my environment and send it to you.

     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Getting Started…

Welcome to the Power Platform Community! We appreciate your visit…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 138,287

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,172

Leaderboard