Is it possible to directly parse a nested json response returned by getrestproxy in a cxone studio snippet without using intermediate string manipulation? i am calling an internal service via the rest proxy action to fetch user metadata. the response is a valid json object with nested arrays. when i assign the response to a variable using the assign action, it treats the entire payload as a string. accessing fields like response.data.items[0].id fails because the parser does not recognize the json structure. i have tried converting the string to an object using standard javascript methods within the snippet, but the sandbox environment restricts external libraries. here is the snippet logic i am using:
the api returns 200 ok. the issue is strictly within the studio snippet execution context. how do i deserialize this string into a usable object or array within the snippet constraints?
If I remember correctly, getrestproxy in CXone Studio returns a stringified payload. You must parse it explicitly before accessing nested arrays. Use json.parse({{response.body}}) to convert the string to an object. Then, reference {{parsedResponse.data.items[0].id}} in subsequent actions. Direct indexing on the raw string will always fail.
The problem here is assuming the Assign action handles deserialization automatically. You must explicitly call json.parse({{response.body}}) in a prior Assign step to convert the payload before attempting array access.