JSON Actions
  • 03 Jun 2022
  • 1 Minute to read
  • Dark
    Light

JSON Actions

  • Dark
    Light

Article summary

JSON Actions

parseJSON

Parse JSON string.

Property

Value

Description

json*

text, expression, variable

the JSON string to parse

returnVariable

expression, variable

name of the variable to be assigned to the return value

jsonData = '{"name":"Test User","phone":"555-555-1234"}'
parsedData = parseJSON(jsonData)
log(parsedData['name'])
log(parsedData['phone'])

toJSON

Serialize Object, Record, Array, etc. as a JSON string.

Property

Value

Description

item*

expression, variable

the Object, Record, Arrays, etc to serialize

indent

boolean, expression, variable

format/indent JSON result

returnVariable

expression, variable

name of the variable to be assigned to the return value

record = createRecord(false)
record.name = "Test User"
record.phone = "555-555-1234"
log(record)
# displays - {name=Test User, phone=555-555-1234}
jsonStr = toJSON(record, false)
log(jsonStr)
# displays - {"name":"Test User","phone":"555-555-1234"}

Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence