web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / PVA reply depending on...
Copilot Studio
Answered

PVA reply depending on the context

(0) ShareShare
ReportReport
Posted on by 22

Hi,

 

I'm using the production PVA (not preview) and I would like to give a different reply depending if the chat is done on a Teams channel or in a private chat with the bot. As the conversation with the bot can get into private details, I want to suggest the user to move to a private chat with the chatbot, ideally managed on the same topic.

I've been trying to find the right expression or action to identify the conversation ID, but I've been unable to do it. Is there any way to make it? I cannot do it with the Bot Composer way published on the forums and I don't know if it's safe to try moving all my topics to the new preview PVA.

 

Any tip?

 

Thanks a lot!

I have the same question (0)
  • Verified answer
    HenryJammes Profile Picture
    Microsoft Employee on at

    In the production version, I think you would need to use a Bot Framework Composer dialog to get the channel as a variable. A bit like this solution: Solved: How to get conversation ID in Power virtual atent - Power Platform Community (microsoft.com), but using

    =turn.activity.channelId

    You'd then have "directline" (for your website integration) or "msteams" in Teams

     

    Using the preview version in production isn't recommened as you wouldn't get the same level of support from Microsoft in case of issues. 

  • DaniBaeyens Profile Picture
    22 on at

    Thanks for the answer Henry, that's what I meant when I said: "I cannot do it with the Bot Composer way published on the forums". I have access to Power VA but I cannot access to an Azure subscription to deploy my own Bot framework one... that's why I was looking at the preview version which allows that directive. When that will promote to General Availability? 🙂 

  • HenryJammes Profile Picture
    Microsoft Employee on at

    Hi @DaniBaeyens 

     

    Thanks for the additional context! The good news is that extending a Power Virtual Agents with Bot Framework Composer as suggested above doesn't require any Azure component.

    These extensions only use the Bot Framework Composer as an IDE (integrated development environment), just like a developer would use Visual Studio to create .NET applications. The Bot Framework Composer allows you to do additional customizations of your PVA bot, but when published, these are deployed back to your Power Virtual Agents chatbot - not to an Azure subscription, so, you're not adding anything to your current architecture.

     

    The new unified authoring canvas is targeted for general availability (G.A.) this May 2023:

    New and planned features for Power Virtual Agents, 2023 release wave 1 | Microsoft Learn

  • DaniBaeyens Profile Picture
    22 on at

    Uhm, that sounds great. I had a bad misunderstanding... I'll give another try and tell you. Thanks a lot!

  • DaniBaeyens Profile Picture
    22 on at

    Aha! so... I got also confused by the Azure login or I remember when I was testing to have a chatbot with skills... Nevertheless, I've been able to follow your old thread and create the dialog successfully 🙂

     

    I thought that channelId could easily reveal if a chat is coming from a channel or a 1:1 chat with the bot. Seeing the debug strings, I see the @thread.skype trail and the message Id. Should I just check the messageId to verify that condition or is there any other easier way to know that condition?

  • HenryJammes Profile Picture
    Microsoft Employee on at

    Doesn't turn.activity.channelId return the channel?
    I.e. msteams for Teams, or directline for Direct Line (test canvas, website, app integration...)

  • DaniBaeyens Profile Picture
    22 on at

    I followed that strictly the old post that I even checked for conversationID instead of channelId. 🤦🏻‍♂️

    Still, my target is knowing if I'm on a Teams team channel or a Teams 1:1 conversation (I think "channel" is misleading" if we consider all possible bot channels :P). On my first test, I've got "message" as channelId for both a teams channel and a 1:1 conversation... 🤔

     

    I've been browsing botframework-sdk/botframework-activity.md at main · microsoft/botframework-sdk (github.com)

    but it's a little bit harsh for guessing the right one. I'll try to dive deeper (or find a easier doc 😇)

  • DaniBaeyens Profile Picture
    22 on at

    Uhm, sorry. With ChannelID I get a response like:

    {52912a94-6138-4af3-ace3-ecb1e2a91b0a} no matter if it's on a direct message or a teams channel...
  • DaniBaeyens Profile Picture
    22 on at

    Somehow retrying it has worked... 🤷🏻‍♂️

    I get directline on the Test Bot blade, msteams on a channel and the Principal User Name when it's on a 1:1 chat. That's perfect for my use case! Thanks a lot for the help!

  • HenryJammes Profile Picture
    Microsoft Employee on at

    Awesome! 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 637

#2
chiaraalina Profile Picture

chiaraalina 171 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 141

Last 30 days Overall leaderboard