Legacy Dev Forum Posts

 View Only

Sign Up

Data Action returns an array of array and Architect does not work

  • 1.  Data Action returns an array of array and Architect does not work

    Posted 06-05-2025 18:44

    fvidalba | 2023-03-21 15:21:39 UTC | #1

    Hi

    I would like to use the api "/api/v2/analytics/conversations/details/query" as a Data Acion with active calls and some details.

    The response from this data action is as follows to obtain the segment's sessions:

    { "translationMap": { "IDLLamOriginal": "$.conversations[0].conversationId", "total": "$.totalHits", "SEGMENTO4": "$.conversations[3].participants[?(@.purpose=='station')].sessions[0].segments", "SEGMENTO3": "$.conversations[2].participants[?(@.purpose=='station')].sessions[0].segments",

    "HoraLLamadaEntranteEnExtension": "$.conversations[0].participants[?(@.purpose=='station')].sessions[0].segments[?(@.segmentType=='interact'

    @.segmentType=='alert'

    @.segmentType=='hold')].segmentStart",

    "HoraLLamadaFinEnExtension": "$.conversations[0].participants[?(@.purpose=='station')].sessions[0].segments[?(@.segments[?(@.segmentType=='interact'

    @.segmentType=='alert'

    @.segmentType=='hold')].segmentEnd",

    "SEGMENTO2": "$.conversations[1].participants[?(@.purpose=='station')].sessions[0].segments", "SEGMENTO1": "$.conversations[0].participants[?(@.purpose=='station')].sessions[0].segments" }, "translationMapDefaults": { "IDLLamOriginal": "\"none\"", "total": "0", "SEGMENTO4": "[\"None\"]", "SEGMENTO3": "[\"None\"]", "HoraLLamadaEntranteEnExtension": "[\"None\"]", "HoraLLamadaFinEnExtension": "[\"None\"]", "SEGMENTO2": "[\"None\"]", "SEGMENTO1": "[\"None\"]" }, "successTemplate": "{\"total\":${total},\"IDLLamOriginal\":${IDLLamOriginal},\"HoraInicio\":${HoraLLamadaEntranteEnExtension},\"HoraFin\":${HoraLLamadaFinEnExtension},\"SEGMENTO1\":${SEGMENTO1},\"SEGMENTO2\":${SEGMENTO2}},\"SEGMENTO3\":${SEGMENTO3}},\"SEGMENTO4\":${SEGMENTO4}}" }

    It publishes correctly, but cannot make it work in Architect, as it in jsonpath is like this:

    [ [ { "conference": false, "segmentEnd": "2023-03-17T11:58:26.903Z", "segmentStart": "2023-03-17T11:58:24.446Z", "segmentType": "alert" }, { "conference": false, "segmentEnd": "2023-03-17T12:00:16.249Z", "segmentStart": "2023-03-17T11:58:26.903Z", "segmentType": "interact" }, { "conference": false, "disconnectType": "transfer", "segmentEnd": "2023-03-17T12:00:30.488Z", "segmentStart": "2023-03-17T12:00:16.249Z", "segmentType": "hold" } ] ]

    It is an Array of Arrays.

    I can see in Architect this error: "Action success, failure, or output information could not be loaded."

    Thanks Francesc


    Jason_Mathison | 2023-03-21 17:24:36 UTC | #2

    Could you post an export of your action and an example of the response you are getting from the endpoint (You can get that by expanding the "Execute" step in the test mode UI).

    Feel free to redact any sensitive information, but the shape of the data needs to remain unchanged.

    --Jason


    system | 2023-04-21 17:25:31 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 19026