How to parse or read a http response if there is a dot (.) in the JSON key

I am able to correctly hit the ServiceNow API and get a response but it comes back in an array:

“body”: {
“result”: [
“”: “My Name”
“”: “Another Name”
“name” : “ABC- Application”

I tried to use it with “” but I think the “.name” is messing it up or I need to do something with teh array like “result[0]” Im not sure how to use the response in a message. I assume it has to do with the “result” being an array.


Say you need the result> name, you will need to use


However, although JSON response can technically have “.” in the string, the platform may have difficulty parsing it. So you may need to massage the data receive, cleanse the response, and replace all “.” with “_”.
Example: “” to “u__ctb_system_director_name”

It will be better if you have control of the third-party system to not have “.” inside the JSON keys.


So unfortunately the data source is ServiceNow and cant be changed but if I am understanding I can use like this?

Does that look right?


@anthony.hibbitts Does it work for you? Even if it does I will need to get this reviewed the the dev team once so that backward compatibility can be ensured.

No it doesnt not work I tried both:
context.get_info.response.body.result[0].u_application_technical_lead"."name and

Not sure how to massage the data when it comes through.

I think I figured out a solution and it may not need data massaging (otherwise regex based replaceall should have been
Take this code for example:

var res = {
    "statusCode": 200,
    "body": {
        "result": [{
                "": "My Name",
                "": "Another Name",
                "name": "ABC- Application"

If I execute this in the browser console, it will work.

Same way, in the bot also, if I set a context value in the script node like

And print in a message node like this

It will work.

1 Like