GlideRecord: Convert to JSON (Functional)
Developing Creative Business Solutions On ServiceNow on CodeCreative | A ServiceNow Blog
·
Aug 10, 2021
·
article
Purpose: How to write a GlideRecord loop to convert the GlideRecord to a Javascript Object or JSON Object using a Functional Programming style Use: Use this script in a Server Script. Typically this will be used in Scripted REST Endpoint, Service Portal Widget’s Server Script, or GlideAjax Script Include. Depending on the specific place used, conversion from a Javascript Object to a JSON string may be automatic. This technique can output either an array or an object / map depending on the intended goal.
View original source
https://codecreative.io/notebook/gliderecord-patterns-to-json-fp/