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

  • Home
  • SEARCH
  • 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 8286193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:39:10+00:00 2026-06-08T11:39:10+00:00

I am a novice trying to deserialize my result from an onSuccess function as

  • 0

I am a novice trying to deserialize my result from an onSuccess function as :

 "onResultHttpService": function (result, properties) {
  var json_str = Sys.Serialization.JavaScriptSerializer.deserialize(result);
  var data = [];
  var categoryField = properties.PodAttributes.categoryField;
  var valueField = properties.PodAttributes.valueField;
  for (var i in json_str) {                   
       var serie = new Array(json_str[i] + '.' + categoryField, json_str[i] +     '.' + valueField);
                data.push(serie);
       }

The JSON in result looks like this:

[
    {
        "Text": "INDIRECT GOODS AND SERVICES",
        "Spend": 577946097.51
    },
    {
        "Text": "LOGISTICS",
        "Spend": 242563225.05
    }
]

As you can see i am appending the string in for loop..The reason i am doing is because the property names keep on changing therefore i cannot just write it as

 var serie = new Array(json_str[i].propName, json_str[i].propValue);

I need to pass the data (array type) to bind a highchart columnchart. But the when i check the var serie it shows as

serie[0] = [object Object].Text
serie[1] = [object Object].Spend

Why do i not get the actual content getting populated inside the array?

  • 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-06-08T11:39:11+00:00Added an answer on June 8, 2026 at 11:39 am

    You’re getting that because json_str[i] is an object, and that’s what happens when you coerce an object into a string (unless the object implements toString in a useful way, which this one clearly doesn’t). You haven’t shown the JSON you’re deserializing…

    Now that you’ve posted the JSON, we can see that it’s an array containing two objects, each of which has a Text and Spend property. So in your loop, json_str[i].Text will refer to the Text property. If you want to retrieve that property using the name in categoryField, you can do that via json_str[i][categoryField].

    I don’t know what you want to end up with in serie, but if you want it to be a two-slot array where the first contains the value of the category field and the second contains the value of the spend field, then

    var serie = [json_str[i][categoryField], json_str[i][valueField]];
    

    (There’s almost never a reason to use new Array, just use array literals — [...] — instead.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a novice at this, nor is this my data. We are trying
I am a novice R user trying to work with a data set of
I am trying to write a function in PHP, but being a novice I
I'm a JavaScript novice trying to build a basic share button as a learning
I'm an encryption novice trying to pass some values back and forth between systems.
SQL novice here. I'm trying to get a list of invoice numbers. There are
I am novice to python and I am trying to understand a basic error
I'm a novice programmer and I'm trying to learn Android coding using Eclipse. This
I apologize for the novice question but I'm trying to get oriented with OpenJDK.
I'm a novice Android monkey and I've hit a snag trying to implement a

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.