Legacy Dev Forum Posts

 View Only

Sign Up

Data Action - Get value from JSON output fro

  • 1.  Data Action - Get value from JSON output fro

    Posted 06-05-2025 18:44

    mohannad_haddad | 2023-04-10 19:52:05 UTC | #1

    Greetings Team

    Hi all, hope someone can assist, i am getting Wrap-up value via API =/api/v2/conversations/calls/${input.conversationId}

    data is returned in JSON format and require only the Wrap-up code value to assign to an output.

    i have attached a screenshots of what I did in DA, hoping someone is able to guide me in the right direction.

    ![snip

    690x208](upload://traO1G4rdCA3eogOl8MeH4kn06H.png)

    ![snip2

    690x264](upload://eQ9GuKQBrWtjPrl8KhGGTgtheHB.png)

    ![snip3

    690x237](upload://hEdi8SIgu7KPxN3corf5wf2oqIK.png)


    mostafaawad | 2023-03-25 02:39:47 UTC | #2

    Hi @mohannad_haddad

    You need to use JSON-Path expression in the response configuration template then you can configure you contracts based on the response.

    So your response configuration should be something similar to this:

    { "translationMap": { "wrapupcode": "$.participants[?(@.purpose==\"agent\")].wrapup.code" }, "translationMapDefaults": { "wrapupcode": "\"[]\"" }, "successTemplate": "{\"particpantId\":${successTemplateUtils.firstFromArray(${participantId},\"\")}}" }

    And your contracts should be similar to this:

    Hope this could help.


    mohannad_haddad | 2023-03-26 13:18:02 UTC | #3

    @mostafaawad thank you for your response, I tried it and its working fine, Now I would like to see how I can list multiple values that returned from AP, to Script drop down list


    Jason_Mathison | 2023-03-27 14:57:06 UTC | #4

    See if this thread can help you get the results into a drop-down list: https://developer.genesys.cloud/forum/t/extract-array-elements-within-script/16274/5


    mohannad_haddad | 2023-03-27 19:15:01 UTC | #5

    unfortunately I tried and It didn't work as its still show me the returned array result in one line, I'm looking to how

    to fill the drop down list with the returned data,


    system | 2023-04-27 19:15:20 UTC | #6

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