Hi @argeraju
I actually tried something new to get the transcript, you may disregard the "Escalate" approach.
This works for conversations happening on the Direct Line channel (website, custom app, etc.)
I basically:
- Pass the Direct Line token as a global variable from the canvas at conversation start
- When I want to generate the transcript, I:
- Make an HTTP call to the Direct Line API with the conversation ID and token
- Filter the activities table to the messages
- Build an adaptive card to display them

To pass the Direct Line token, I just add this value to the default canvas:
https://learn.microsoft.com/en-us/microsoft-copilot-studio/customize-default-canvas?tabs=web#customize-the-default-canvas-simple

On the Copilot Studio side, I create a custom topic where I ask the questions to capture the input Global variable(s):

For my example, I create a Transcript topic, where I make an HTTP call to the Direct Line API to retrieve the conversation activities. I use the System.Conversation.Id and Global.DirectLineToken variables:

And then with some Power Fx formula I isolate the messages to build the transcript as a table and then display it to the user as an adaptive card.
Here's the full topic YAML:
kind: AdaptiveDialog
beginDialog:
kind: OnRecognizedIntent
id: main
intent:
triggerQueries:
- Transcript
actions:
- kind: HttpRequestAction
id: Uaai35
url: "=\"https://directline.botframework.com/v3/directline/conversations/\" & System.Conversation.Id & \"/activities\""
headers:
Authorization: "=\"Bearer \" & Global.DirectLineToken"
response: Topic.Transcript
responseSchema:
kind: Record
properties:
activities:
type:
kind: Table
properties:
attachments:
type:
kind: Table
properties:
content:
type:
kind: Record
properties:
$schema: String
body:
type:
kind: Table
properties:
text: String
type: String
wrap: Boolean
type: String
version: String
contentType: String
channelId: String
conversation:
type:
kind: Record
properties:
id: String
entities:
type:
kind: Table
from:
type:
kind: Record
properties:
id: String
name: String
role: String
id: String
inputHint: String
listenFor:
type:
kind: Table
membersAdded:
type:
kind: Table
membersRemoved:
type:
kind: Table
name: String
reactionsAdded:
type:
kind: Table
reactionsRemoved:
type:
kind: Table
replyToId: String
serviceUrl: String
speak: String
suggestedActions:
type:
kind: Record
properties:
actions:
type:
kind: Table
properties:
text: String
title: String
type: String
value: String
to:
type:
kind: Table
text: String
textFormat: String
textHighlights:
type:
kind: Table
timestamp: String
type: String
- kind: SetVariable
id: setVariable_Ej7JF3
variable: Topic.TranscriptTable
value: |-
=ForAll(
Filter(Topic.Transcript.activities, type = "message"),
{
from: If(from.role = "bot", "Bot: ", "User: "),
text: text
}
)
- kind: SendActivity
id: sendActivity_tVLuEw
activity:
attachments:
- kind: AdaptiveCardTemplate
cardContent: |-
={
type: "AdaptiveCard",
'$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
version: "1.5",
body: [
{
type: "Container",
items: [
{
type: "TextBlock",
text: "Conversation ID: " & System.Conversation.Id,
wrap: true,
size: "Small",
weight: "Lighter"
},
{
type: "TextBlock",
text: "Date: " & Now(),
wrap: true,
size: "Small",
weight: "Lighter"
}
]
},
{
type: "Table",
columns: [
{
width: "1"
},
{
width: "4"
}
],
rows: ForAll(Topic.TranscriptTable,
{
type: "TableRow",
cells: [
{
type: "TableCell",
items: [
{
type: "TextBlock",
text: from,
wrap: true,
weight: "Bolder"
}
]
},
{
type: "TableCell",
items: [
{
type: "TextBlock",
text: text,
wrap: true
}
]
}
]
}
),
firstRowAsHeaders: false
}
]
}