Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Get Conversation Attribute - Data Action

    Posted 29 days ago

    Hello! I am trying to get the Get Conversation Attribute Data Action to work and am running into an issue with the success template. I get the following error when I run the test: 

    {
      "message": "Transform failed to process result using 'successTemplate' template due to error:'Unexpected character ('}' (code 125)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 12]'\n Template:'{\"value\": ${successTemplateUtils.firstFromArray(${value})}}'.",
      "code": "bad.request",
      "status": 400,
      "messageParams": {},
      "contextId": "aeab47c6-11cc-47a8-9493-a988be3ddccc",
      "details": [
        {
          "errorCode": "ACTION.PROCESSING"
        }
      ],
      "errors": []
    }

    Response configuration:

    {
      "translationMap": {
        "value": "$..key"
      },
      "translationMapDefaults": {},
      "successTemplate": "{\"value\": ${successTemplateUtils.firstFromArray(${value})}}"
    }

    Input Contract:
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "object",
      "properties": {
        "conversationId": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }

    Output Contract:
    {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "object",
      "required": [
        "value"
      ],
      "properties": {
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }

    #Integrations

    ------------------------------
    Dietrich Van Horn
    America First Credit Union
    ------------------------------


  • 2.  RE: Get Conversation Attribute - Data Action

    Posted 28 days ago

    Hi, give this a try

    "successTemplate": "#set($default = \"NotFound\") {\r\n \"value\": ${successTemplateUtils.firstFromArray(\"${value}\", \"$esc.quote$default$esc.quote\")}\r\n}"


    ------------------------------
    Cheers
    Zubair
    ------------------------------



Need Help finding something?

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