How ServiceNow can store JSON format?

sandeep3791
Tera Contributor

Hi All,

Need a quick help,

I have exposed a CREATE API to some external system, the external system is sending data in the below JSON format.

We had decided to store the dynamic characteristics coming from external system in the Name-Value pair field within ServiceNow.

But the external system is sending those dynamic characteristics in hierarchy which is critical to maintain and if I store it in Name-Value pair it will all become a flat list of characteristics.

Is there a way ServiceNow can store this JSON format hierarchy of characteristics?

find below, first ip address characteristic is related to ABC characteristics and second ip address below is related to APN characteristics. I need to maintain this hierarchy.

find_real_file.png

3 REPLIES 3

perkinsarm
Mega Guru

You could stringify the JSON and store it in a text field. Then retrieve and parse the stored JSON text when you need to work with the actual JSON object.

The ServiceNow JSON API is documented here.

If you must store the hierarchy you'd need to design a table structure that represents a hierarchy of name-value pairs. You'd have to transform the JSON into appropriate records.

sandeep3791
Tera Contributor

is there a way we can have hierarchy defined in the NV pair itself?

sandeep3791
Tera Contributor

Does SNOW sored the NV pair data stored in some internal table, if yes then can we not access that table to define a relationship fields to maintain hierarchy?