Genesys Cloud - Main

 View Only

Discussion Thread View
  Thread closed by the administrator, not accepting new replies.
  • 1.  getting output in 2 seperate arrays

    Posted 10-01-2024 00:39
    No replies, thread closed.

    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
    ------------------------------


  • 2.  RE: getting output in 2 seperate arrays

    Posted 10-01-2024 04:18
    No replies, thread closed.

    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
    ------------------------------



  • 3.  RE: getting output in 2 seperate arrays
    Best Answer

    Posted 10-01-2024 08:07
    Edited by Jason Kleitz 10-01-2024 09:59
    No replies, thread closed.

    Hello Sravanthi, 

    Just to also add to Richard's response. 

    Since this is developing a data action, this might be better suited for our developer forums

    I did find these couple of options as well. 

    1. Blueprint
    2. Idea

    But I think to really get help with this the developer forums are the way to go. 

    Cheers, 



    ------------------------------
    Cameron Tomlin
    Online Community Manager/Moderator
    Genesys - Employees
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources