EncodeJSONBlob (open)
Encode data as a JSON blob
Syntax
// Core function, no LOADLIB necessary
BLOB FUNCTION EncodeJSONBlob(VARIANT arg, RECORD translations, RECORD options)Parameters
VARIANT argData to encode
RECORD translationsTranslations to specify literal cellnames, eg [ somecamelcaps : = "someCamelCaps" ] if you want to literally spell the cells that way
RECORD optionsOptions
BOOLEAN camelcaseConvert cellnames from snake_case to camelCase
BOOLEAN formattedFormat the JSON nicely (with newlines and indents)
BOOLEAN typedIf true, encode Money and Date with "$stdType" records
Return value
BLOBThe encoded blob. Throws if any type could not be converted
Description
Arrays, Integers, strings and booleans are directly converted to their Javascript counterparts. Records are converted to objects, with all cellnames converted to lowercase.