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 / Get ConversationID whe...
Copilot Studio
Unanswered

Get ConversationID when starting a chat

(0) ShareShare
ReportReport
Posted on by 4

Hello team, SOS
I am working on an Omnichannel for Customer Service (D365) implementation. I have a bot developed in PVA that works as a user in D365.

I need from the PVA bot to obtain the conversationid and then with power virtual automate obtain the name of the contact.

I am trying to use the va_conversationId and bot msdyn_liveworkitemid context variables but they work randomly. If I use them in the greeting topic the variable is empty. On the other hand, if I use it after asking some questions, the variable is complete.

 

Context variables take time to initialize? How can I get the conversation id when starting the chat?

 

I need it for multiple channels (facebook, live chat, whatsapp).

 

Thank you!

Categories:
I have the same question (0)
  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    hI @fernarod ,

     

    Unfortunately, you can just get the conversation Id using the Custom Canvas (custom website), using JavaScript you can get all information behind the Html code.

    You can suggest your idea here: https://aka.ms/pva/community/ideas

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at
  • fernarod Profile Picture
    4 on at

    Thanks @renatoromao , from what I see the variable msdyn_liveworkitemid is populated with the conversation id after a few seconds, it is not immediate. For that reason I cannot get the id when starting the conversation.

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @fernarod ,

     

    Yes, today the updates occur after 6 hours.

  • fernarod Profile Picture
    4 on at

    @renatoromao 6 hours? What updates are you talking about?

  • CU22081450-0 Profile Picture
    Most Valuable Professional on at

    @fernarod 

     

    When you talk with the chatbot, the conversation transcript will be stored in a ConversationTranscript entity in 6 hours.

  • HenryJammes Profile Picture
    Microsoft Employee on at

    Resurfacing this old thread to suggest 2 workarounds to get the Conversation ID.

    1) In the new PVA unified authoring canvas (currently in public preview)

    For chatbots created in the new authoring canvas, you can get the conversation id directly from the system variables:

    HenryJammes_0-1669409107541.png

    2) In the production version of PVA, using Bot Framework Composer

    Open the PVA bot with Bot Framework Composer:

    HenryJammes_1-1669409192917.png

    Create a new dialog (e.g. GetConversationId)

    HenryJammes_2-1669409349518.png

    In the dialog, under "Dialog Interface", add a new Output.
    With a key name, e.g. "conversationId" and of type "string".

    HenryJammes_3-1669409448820.png

    In BeginDialog, add a new node of type "Set a property" (under "Manage properties"), and define it with:

    Property: dialog.result.conversationId

    Value: =turn.activity.conversation.id (even if it's not auto-suggested)

    HenryJammes_0-1677772191307.png

     

    In Bot Framework Composer, the final step is to publish the bot:

     

    HenryJammes_5-1669409707196.png

    Back in Power Virtual Agents, in a topic, you can select "Redirect to another topic" and select the "getConversationId" dialog.

    The conversationId variable will be available as an output:

    HenryJammes_6-1669409928357.png

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 310

#2
Vish WR Profile Picture

Vish WR 240

#3
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 225 Super User 2026 Season 1

Last 30 days Overall leaderboard