Solved

Coldfusion Decerialize

Posted on 2014-03-24
2
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 16

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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

623 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