DoArNa
DoArNa

Reputation: 532

How to use the method DeserializeJSON in a ColdFusion file

I have this code: I got an error on page when execute this code. I am trying to figure out how does it look an object that is being deserialized from DeserializeJSON() method and I wrote this simple scenario but it doesn't work. Anyone see what the problem is in here?

<cfset test = '[{"phone":"1001106672","label4":"12","hcats":"18","freshStart":"0","phoneCode":"","hproduct":"12","checked":false},{"phone":"1001106672","label4":"test","hcats":"54","freshStart":"0","phoneCode":"456","hproduct":"15","checked":false}]'>

<cfset test2 =  DeserializeJSON(test)/>

<cfoutput>#test2#</cfoutput>

Upvotes: 1

Views: 113

Answers (1)

Chip Pinkston
Chip Pinkston

Reputation: 96

You're trying to cfoutput a complex object. Try:<cfdump var="#test2#"> instead.

Upvotes: 6

Related Questions