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

deserializeJSON Argument Reference

jsonvar
Required

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

strictMapping
Default: true

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

useCustomSerializer
Required
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