Unable to see SuccessOutputs when call DataAction

Hi all,
i'm having an issue while setting up a call DataAction in an inbound chat flow.
My purpose is to call a custom DataAction i've created.

My dataAction Request:
{
"requestUrlTemplate": "/api/v2/routing/queues/{input.Queue_ID}/users?expand=conversationSummary&skills=livechat&routingStatus=idle%2Cinteracting&presence=on%20queue", "requestType": "GET", "headers": { "UserAgent": "PureCloudIntegrations/1.0", "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "{input.rawRequest}"
}

And the response:
{
"translationMap": {
"ids": ".entities[*].id", "total": ".total",
"activeChat": ".entities.[*].user.conversationSummary.chat.contactCenter.active" }, "translationMapDefaults": {}, "successTemplate": "{\n \"UsersIds\": {ids},\n"totalAgents": {total},\n\"ActiveChat\": {activeChat}\n}"
}

When i add this call to a chat flow, i'm not able to retrieve the results.
I don't see the "Success Outputs" where to save the outputs from the call to my DataAction.
image

This is not my first custom data action. If i insert a different one, i'm able to see Success Outputs menu.

Thanks in advance.

Hello,

What have you defined in your DataAction Input and Output contracts?

Regards,

Hi Jerome,
Input contracts:
{
"title": "QueueIDRequest",
"type": "object",
"properties": {
"Queue_ID": {
"type": "string"
}
},
"additionalProperties": true
}

Output Contracts:
{
"title": "getFreeAgentOnQueue",
"type": "object",
"properties": {
"ids": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"activeChat": {
"type": "object",
"properties": {},
"additionalProperties": true
},
"total": {
"type": "array",
"properties": {},
"additionalProperties": true
}
},
"additionalProperties": true
}

Regards

There were several issues.
In your Output contract, wrong types for most of the objects.
"ids" will be an array (based on your Input configuration and the JSON path in the translationMap)
"total" is an integer and not an array.
"activeChat" will be an array (based on your Input configuration and the JSON path in the translationMap).

In your Output Configuration, some JSON Path were wrong in your translationMap, and the successTemplate didn't match the name of variables you defined in your output contract.

You will need to create a new Data Action as you published your Data Action and you will need to modify the contracts (contracts cannot be modified once a Data Action is published).

The following should work better:

Input Contract:

{
  "title": "QueueIDRequest",
  "type": "object",
  "required": [
    "Queue_ID"
  ],
  "properties": {
    "Queue_ID": {
      "type": "string"
    }
  },
  "additionalProperties": true
}

Output Contract:

{
  "title": "getFreeAgentOnQueue",
  "type": "object",
  "required": [
    "TotalAgents"
  ],
  "properties": {
    "UsersId": {
      "type": "array",
      "items": {
        "title": "UserId",
        "type": "string"
      }
    },
    "UsersNbActiveChat": {
      "type": "array",
      "items": {
        "title": "UserNbActiveChat",
        "type": "integer"
      }
    },
    "TotalAgents": {
      "type": "integer"
    }
  },
  "additionalProperties": true
}

Input Configuration:

{
  "requestUrlTemplate": "/api/v2/routing/queues/${input.Queue_ID}/users?expand=conversationSummary&skills=livechat&routingStatus=idle%2Cinteracting&presence=on%20queue",
  "requestType": "GET",
  "headers": {
    "UserAgent": "PureCloudIntegrations/1.0",
    "Content-Type": "application/x-www-form-urlencoded"
  },
  "requestTemplate": "${input.rawRequest}"
}

Output Configuration:

{
  "translationMap": {
    "ids": "$.entities[*].id",
    "total": "$.total",
    "activeChat": "$.entities[*].user.conversationSummary.chat.contactCenter.active"
  },
  "translationMapDefaults": {},
  "successTemplate": "{\n \"UsersId\": ${ids},\n\"TotalAgents\": ${total},\n\"UsersNbActiveChat\": ${activeChat}\n}"
}

Regards,

Thank you Jerome.
Now it's working fine. It seems that i made some dumb errors

Thanks a lot

Not dumb errors. We all learn by making errors and understand how to correct them. :slight_smile:

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.