Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7186423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:37:42+00:00 2026-05-28T18:37:42+00:00

I have a javascript object: data = { color: red, day: monday, list: {1,2,3,4,5,6}}

  • 0

I have a javascript object:

data = { color: red, day: monday, list: {1,2,3,4,5,6}}

I pass this to a coldfusion page using jQuery:

$.ajax({
                type: "POST",
                url: "ajax_myPage.cfm",
                data: JSON.stringify(data),
                contentType: "application/json",
                dataType: "json" });

This is my cfdump:

enter image description here

(the “list” is actually going to contain a list of emails but I am just testing with one address right now)

In coldfusion, I am trying to assign each “part” to a variable:

<cfset requestBody = toString( getHttpRequestData().content ) />
<!--- Double-check to make sure it's a JSON value. --->
<cfif !isJSON( requestBody )>

<!--- Echo back POST data. --->
<h3>The URL you requested does not provide valid JSON</h3>
<cfdump
var="#requestBody#"
label="HTTP Body"
/>
<cfelse>
 <cfset cfData=DeserializeJSON(requestBody)>
 <cfset color = cfData.color>
 <cfset day = cfData.day>
 <cfset myList = cfData.list>
</cfif>

However I am getting an error with “list”,

Complex object types cannot be converted to simple values. 

How do I parse the list as Coldfusion?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:37:44+00:00Added an answer on May 28, 2026 at 6:37 pm

    i would have sent the data as a post var,

    data: { json: JSON.stringify(data) }
    

    and then parsed it into a variable:

    <cfset structJSON = deserializeJSON(FORM.json)>
    

    At that point, cfdump the structure to inspect it’s contents so that you know how to access them.

    Since we don’t know what the json structure you are passing to ColdFusion consists of, I have no idea what structJSON.list contains or why it would be throwing an error.

    Edit: Ah i see your json now.

    Your list is not valid json, change { and } to [ and ].

    data = { color: "red", day: "monday", list: [1,2,3,4,5,6]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a javascript object literal? I access them in my webpage as data.list[i].ger
Have some JavaScript that assigns values to an object using $.data and then uses
I have a javascript that does this (http is your XMLHttpRequest object) var r
OK Ive written this neat javascript 'thing' using jquery and ajax. Its all based
I have an object in Javascript that looks like this function MyObject(){ this.name=; this.id=0;
I have a nested javascript object called data. Is there any way to iterate
I have a javascript object (I actually get the data through an ajax request):
I have a javascript object that I would like to update with data from
I have a Javascript object that (very simplified) looks like this if('undefined' !== typeof(listCtrls)){
I have a nested Javascript object like var data = { 'name': { 'heading':

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.