Data Structure Field Type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 04:58 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 05:05 AM
Have a look a this post, it may help you:
https://community.servicenow.com/community?id=community_question&sys_id=777bc361db9cdbc01dcaf3231f96190e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 05:18 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 05:25 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2018 05:54 AM
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.