cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
328
Views
0
Helpful
2
Replies

UCCX editor 12.5 parse array from JSON

Genadi
Level 1
Level 1

Hello,

I am sending REST API GET request and i receive the next response:

{
    "result": {
        "data": [
            {
                "entityFullName""Test user1",
                "extentionNumber""1",
                "caseNumbers": [
                    "00013",
                    "00015",
                    "00017",
                    "00019",
                    "00020",
                    "00021",
                    "00026",
                    "00030",
                    "00031"
                ]
            },
            {
                "entityFullName""test user 2",
                "extentionNumber""2",
                "caseNumbers": [
                    "00032"
                ]
            }
        ]
    }
}
I want to pare caseNumbers and write them to veriables like casenumber1,casenumber2,casenumber3 till casenumber20. How can i do that? Currently my script looks like 
Genadi_0-1707227795582.pngGenadi_1-1707227858299.png

 

 
1 Accepted Solution

Accepted Solutions

So the following $.result.data[0].caseNumbers[*], will return ["00013","00015","00017","00019","00020","00021","00026","00030","00031"]. From there you just loop through it and you should be good to go.

david

View solution in original post

2 Replies 2

Maybe this post can help you? How to get a value from a JSON array in UCCX? 



Response Signature


So the following $.result.data[0].caseNumbers[*], will return ["00013","00015","00017","00019","00020","00021","00026","00030","00031"]. From there you just loop through it and you should be good to go.

david