deserializeJSON

Converts a JSON (JavaScript Object Notation) string data representation into CFML data, such as a CFML structure or array.

deserializeJSON(jsonvar [, strictMapping, useCustomSerializer]) → returns Any

Argument Reference for the deserializeJSON function

jsonvar

Required: Yes
A string that contains a valid JSON construct, or variable that represents one.

strictMapping

Required: No
Default: true
A Boolean value that specifies whether to convert the JSON strictly. If true everything becomes structures.

useCustomSerializer

Required: Yes
Default: true

Examples sample code invoking the deserializeJSON function


Convert JSON into CF Structure

person = deserializeJSON( '{"company":"Foundeo","name":"Pete Freitag"}' );
writeOutput( person.company );

Expected Result: Foundeo


Fork me on GitHub