Solved

Coldfusion Decerialize

Posted on 2014-03-24
2
225 Views
Last Modified: 2014-03-25
I decerialize the CF structures. and it works just fine. Now I am decerializing the the string but structure works and the other one does not. I am getting an error message

JSON parsing failure at character 4:'R' in "{"RUBRICTITLE":"test rubric22","OBSERVESELF":1,"INPERSON":0,"USENOTOBSERVED":1,"TRIGGERDAYS":0,"FIXEDDUEDATE":"","REPEATPERIOD":0,"DUEDATERULE":0,"ASSIGNMENTNAME":"msg test 1 - self","MAXPOINTS":3,"ASSIGNMENTTYPE":0,"ANONYMOUS":0,"RUBRICASSIGNMENTID":47}"
0
Comment
Question by:erikTsomik
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 39951186
If that's your real JSON string, it's because the string is enclosed in double quotes, so it's not valid JSON.

(quote){"RUBRICTITLE":"test rubric22",.... ,"RUBRICASSIGNMENTID":47}(quote)

Remove them and it will parse correctly:

<cfsavecontent variable="text">{"RUBRICTITLE":"test rubric22","OBSERVESELF":1,"INPERSON":0,"USENOTOBSERVED":1,"TRIGGERDAYS":0,"FIXEDDUEDATE":"","REPEATPERIOD":0,"DUEDATERULE":0,"ASSIGNMENTNAME":"msg test 1 - self","MAXPOINTS":3,"ASSIGNMENTTYPE":0,"ANONYMOUS":0,"RUBRICASSIGNMENTID":47}</cfsavecontent>
<cfdump var="#deserializeJSON(text)#">
0
 
LVL 15

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39952324
Check your json string with json parser:

http://jsonlint.com/

Just checked, This is your valid JSON Format:

{
    "RUBRICTITLE": "test rubric22",
    "OBSERVESELF": 1,
    "INPERSON": 0,
    "USENOTOBSERVED": 1,
    "TRIGGERDAYS": 0,
    "FIXEDDUEDATE": "",
    "REPEATPERIOD": 0,
    "DUEDATERULE": 0,
    "ASSIGNMENTNAME": "msg test 1 - self",
    "MAXPOINTS": 3,
    "ASSIGNMENTTYPE": 0,
    "ANONYMOUS": 0,
    "RUBRICASSIGNMENTID": 47
}

Open in new window


Just remove quotes from the start and the end
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now