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 8687953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:14:32+00:00 2026-06-12T23:14:32+00:00

How do you extract multiple values from a JSON complex object / multidimensional array?

  • 0

How do you extract multiple values from a JSON complex object / multidimensional array?

{
    "Items": [{
        "node": {
            "titre": "myTitle",
            "representation": {
                "1": "09 Octobre 2012 - 19:30",
                "2": "10 Octobre 2012 - 20:30",
                "3": "11 Octobre 2012 - 19:30"
            },
            "photo": {
                "1": "photo_1.jpg",
                "2": "photo_2.jpg",
                "3": "photo_3.jpg",
                "4": "photo_4.jpg"
            }
        }
    }]
}

For now, I’m using:

$.getJSON(url, function (data) {
    $.each(data.Items, function (i, node) {
        var titre = node.node.titre;
        var representation = node.node.representation;
        var photo = node.node.photo;
    }
    });

The result for titre is good, but for representation and photos, it renders:[object Object].

  • 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-12T23:14:34+00:00Added an answer on June 12, 2026 at 11:14 pm

    That is because Your photo here is an object ..

    To access the values inside it you would need to use the keys 1 , 2 ,3, 4

     So var photo = node.node.photo;  // Is an Object 
    
     var photo1 = node.node.photo["1"] // photo_1.jpg
       var photo2 = node.node.photo["2"] // photo_2.jpg
       var photo3 = node.node.photo["3"] // photo_3.jpg
    

    // same logic applies for representation

     var representation1 = node.node.representation["1"] // 09 Octobre 2012 - 19:30
       var representation2 = node.node.representation["2"] // 10 Octobre 2012 - 20:30
       var representation3 = node.node.representation["3"] // 11 Octobre 2012 - 19:30
    

    To iterate over this you can try this

    $.each(node.node.photo , function(key , value){
    
        console.log( value);
    });
    

    Check FIDDLE

    EDIT

    entry = {
                    representation :[ sps.node.representation["1"],sps.node.representation["2"],sps.node.representation["3"] ],
                    title: sps.node.titre,
                    image: sps.node.image,
                    acteurs: sps.node.acteurs,
                    acteursuite: sps.node.acteurs_suite,
                    lien: sps.node.lien,
                    description: sps.node.corps,
                    pics: sps.node.photo
                };
    
    for( var i = 0; i< entry.representation.length ; i++){
    
         alert(entry.representation[i]);
    }
    

    //
    FOR FIDDLE

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

Sidebar

Related Questions

I have situation where I want to extract multiple values from multiple source objects
I would like to use the wikipedia API to return the extract from multiple
How to extract multiple data from XML file using NSIS? I used UpdateXml to
Extract a particular column value from multiple files ls -ltr -rwxr-xr-x 4 dc staff
I'm trying to extract values from a string which are between << and >>.
I have inserted multiple values from select statement in a single column using implode
I am trying to extract values from an XML file using linq to create
I have a variable obj: Option[MyObject] and want to extract multiple variables from it
Let's say I want to handle multiple return values from a remote service using
Needing a bit help getting multiple values from a string using Regex. I am

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.