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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:35:52+00:00 2026-05-23T17:35:52+00:00

I want to parse JSON data which is coming in like: { 212315952136472: {

  • 0

I want to parse JSON data which is coming in like:

{
   "212315952136472": {
      "id": "212315952136472",
      "name": "Ready",
      "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/195762_212315952136472_4343686_s.jpg",
      "link": "http://www.hityashit.com/movie/ready",
      "likes": 5,
      "category": "Movie",
      "description": "Check out the reviews of Ready on  http://www.hityashit.com/movie/ready"
   }
}

The code I am using is:

JSONElement userJson = JSON.parse(jsonResponse)
userJson.data.each {
    Urls = it.link
}

But I am not able to get anything assigned to Urls. Any suggestions?

  • 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-23T17:35:53+00:00Added an answer on May 23, 2026 at 5:35 pm

    That response is a Map, with a single element with key ‘212315952136472’. There’s no ‘data’ key in the Map. If you want to loop through all entries, use something like this:

    JSONObject userJson = JSON.parse(jsonResponse)
    userJson.each { id, data -> println data.link }
    

    If you know it’s a single-element Map then you can directly access the link:

    def data = userJson.values().iterator().next()
    String link = data.link
    

    And if you knew the id (e.g. if you used it to make the request) then you can access the value more concisely:

    String id = '212315952136472'
    ...
    String link = userJson[id].link
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to populate a collection from an json file, which has other data
I want to parse a config file sorta thing, like so: [KEY:Value] [SUBKEY:SubValue] Now
I'm looking for a JSON parser and encoder for .NET that can parse JSON
I have a 1GB json file and i want to parse it using simplejson
Just wondering which is best here. I want to output data from a table
I have the following code: page = Net::HTTP.get_response(URI.parse('http://www.enhancetv.com.au/tvguide/rss/melbournerss.php')).body rescue nil show_info = Hash.from_xml(page).to_json puts
I want to parse a JSON string: MyJsonString: { status: ok, count: 2, count_total:
I've made a little forum and I want parse the date on newest posts
I want to parse some HTML in order to find the values of some
I want to parse a web page in Groovy and extract all of the

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.