But I think to really get help with this the developer forums are the way to go.
Original Message:
Sent: 10-01-2024 04:17
From: Richard Chandler
Subject: getting output in 2 seperate arrays
Hi Sravanthi,
This looks like you are trying to send a messaging transcript. In which case you may want to look at the example blueprint. However for API queries like this you are better off with the developer forum.
However you may find the below translation map more useful.
{
"translationMap": {
"messages": "$[0].messagingTranscript[?(@.messageText)].messageText",
"purposes": "$[0].messagingTranscript[?(@.messageText)].purpose"
},
"translationMapDefaults": {
"messages": "[]",
"purposes": "[]"
},
"successTemplate": "{\"messages\": ${messages}, \"purposes\": ${purposes}}"
}
https://developer.genesys.cloud/blueprints/send-message-transcript-by-email/
------------------------------
Richard Chandler
Connect
Original Message:
Sent: 10-01-2024 00:38
From: sravanthi dhurjety
Subject: getting output in 2 seperate arrays
Our requirement is to use the Genesys recordings API /api/v2/conversations/${input.conversationId}/recordings and get the transcript and send the transcript to user after ACW using triggers.
I am using below output contract
{
"title": "Transcript",
"type": "object",
"properties": {
"Transcript": {
"type": "array",
"items": {
"title": "MessageO",
"type": "object",
"properties": {
"purpose": {
"type": "string"
},
"messageText": {
"type": "string"
}
},
"additionalProperties": true
}
}
},
"additionalProperties": true
}
and below is my response template
{
"translationMap": {
"MessageO": "$..messagingTranscript[*]['purpose', 'messageText']"
},
"translationMapDefaults": {},
"successTemplate": "{\"Transcript\" : $MessageO}"
}
I am using below link for my reference
https://developer.genesys.cloud/forum/t/translate-data-action-response/24238/7
I am getting output like this if I don't flatten the output while testing inside data action test menu
{
"purpose": "customer"
},
{
"messageText": "Hi There, an Agent will be with you soon",
"purpose": "workflow"
},
{
"purpose": "agent"
}
]
When I am using same data action inside architect flow, I am getting it like 2 separate variables
{
"Transcript.purpose": [
"customer",
"workflow",
"customer",
"workflow",
"
],
"Transcript.messageText": [
"hi",
"In order to connect you to the right team, please tell us the reason for your contact today in a few words. For example 'Book a repair' or \"Change address\"\n \nPlease don't share any personal details that aren't requested. Domestic & General won't ask for information such as credit card details to verify your identity.",
"human",
"You want to speak to an advisor. Is that correct?",
"Yes",
]
}
Instead of 2 variables, I want my output to be in one variable, because I want to send purpose followed by messageText as transcript to user using email. Please help me in rectifying this issue. Expected output in email is this
{
"purpose": "customer"
},
{
"messageText": "Hi There, an Agent will be with you soon",
"purpose": "workflow"
},
{
"purpose": "agent"
}
#API/Integrations
------------------------------
sravanthi dhurjety
Hexaware Technologies Limited
------------------------------