Data Structure Field Type

Asbj_rn
Mega Expert

Hi fellow Service Professionals. 

How would you go about defining a object to store in a field with the data structure type? 

Case: scripted web service that writes to transform table. We have to accept a complex datatype via rest. That type will then be processed and stored in the designated target tabel. 

 

4 REPLIES 4

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Have a look a this post, it may help you:

 

https://community.servicenow.com/community?id=community_question&sys_id=777bc361db9cdbc01dcaf3231f96190e

 

 

Thank you for the reply. 

but that post does not clarify the usage of the field type in question. you could always store a json as string value use JSON to convert it. 

But we do not have complete control over the datastructure that the out consume is able to generate. Thus we striving to mimic the object that the api consumer is easily able to provide. 

I think from my side the easiest way is to make the field a string, and inside you can manipulate the data as you wish.

 

Asbj_rn
Mega Expert

Went with using the field type NameValue-pairs.
using script i were able get properties basesd on knowing the names of attributes that incoming object would contain.