• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it possible to iterate an JSON map object without keys?

 
Ranch Hand
Posts: 54
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

Is it possible to iterate an JSON map object without keys? I have an Json object like the one below


the keys size, color and material are dynamically generated . How to iterate the map by fetching it's keys dynamically?
 
author
Posts: 15385
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use code blocks when you post code.

Also watch out for the trailing comma, IE hates that.

 
Deepakkumar Devarajan
Ranch Hand
Posts: 54
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks For helping.... How do I further fetch the values using the keys fetched? I missed to the coding in code tag..

 
Eric Pascarello
author
Posts: 15385
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Deepakkumar Devarajan wrote:How do I further fetch the values using the keys fetched?



Did you run the example I gave you? The answer is there.

Eric

 
Deepakkumar Devarajan
Ranch Hand
Posts: 54
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:

Deepakkumar Devarajan wrote:How do I further fetch the values using the keys fetched?



Did you run the example I gave you? The answer is there.

Eric



Thanks Eric. I did not notice obj[key]. Thanks a ton for helping... this really helped me. :-)
 
Is this the real life? Is this just fantasy? Is this a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic