Can anyone explain what is JSON in servicenow

SKum
Kilo Sage

where is this JSON used and why and also the benefits from this

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

JSON stands for JavaScript Object Notation. It is not specific to ServiceNow, but available to JavaScript: Reference- JSON



It is a way of expressing your objects in a string notation - using methods like JSON.stringify() and converting those strings back to objects with JSON.parse().



This allows you to send complex information between systems or between the server and the browser, etc. in a textual format and turn it in to "intelligent" data on the other end. Very powerful!



You might be interested in episode 33 here as an example:



TechNow Episode List


View solution in original post

12 REPLIES 12

Ah. Thanks for the clarification. JSON is pretty cool. I use it all the time (even this morning with a REST API.)



I hope you find that video helpful.



Getting Started with REST - ServiceNow Wiki


REST API Explorer - ServiceNow Wiki


REST API  


Yes, its one of many different ways to facilitate communications between systems.   For example I'm using a REST integration to pull data from a mobile device database.   Their API is returning all the mobile device table data to me in JSON, which I'm then parsing.   Once parsed, I treat it very much like GlideRecord data.   Loop through, transform, insert/update.


Hi Robert,



I see your posts all the time!



Can we call a field name in JSON?



For example:



"secondary_fields": {


              "value": "number,sys_updated_on,incident_state,caller_id,u_logged_in_user",


"displayValue": "number,sys_updated_on,incident_state,caller_id,u_logged_in_user"


}



We have this currently setup for a "Simple List" widget Instance.



The values and everything show up, but I wanted to label them or add a name before the data.



So like Incident Number = Number, Last Updated On = sys_updated_on etc.



I wasn't sure if you can call the field name in there somewhere.



I've tried an additional row with "Label", "Name", etc. and it didn't seem to work.



Wasn't sure if it was allowed as JSON may be pulling just the data and not able to show it any other way?



Thanks!



Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!