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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:48:32+00:00 2026-05-27T08:48:32+00:00

This is a string I am getting back from FB { id: 5672*****, name:

  • 0

This is a string I am getting back from FB

 {
   "id": "5672*****",
   "name": "Mark C*****",
   "first_name": "Mark",
   "last_name": "Cooney",
   "link": "http://www.facebook.com/*****",
   "username": "******",
   "hometown": {
      "id": "111923368834041",
      "name": "Beverley, East Riding of Yorkshire"
   },
   "location": {
      "id": "113198525359593",
      "name": "Littleport, Norfolk, United Kingdom"
   },
   "favorite_teams": [
      {
         "id": "149121281832578",
         "name": "Keep F1 on BBC"
      }
   ],
   "gender": "male",
   "email": "kingte*********",
   "locale": "en_GB",
   "languages": [
      {
         "id": "106059522759137",
         "name": "English"
      }
   ],
   "verified": true,
   "updated_time": "2011-12-07T12:55:03+0000"
}

Obviously starred regions out for security.

I call the top levels like id, first_name, last_name, link etc no problems using this code!!

Private Sub JSONit(ByVal str As String)
    Try

        Dim j As New JSON.JsonObject(str)
        Dim id As String = j("id")
        Dim first_name As String = j("first_name")
        Dim last_name As String = j("last_name")
        Dim link As String = j("link")

        Response.Write(id & ", " & first_name & ", " & last_name & ", " & link)
    Catch ex As Exception
        Response.Write(ex.Message)
    End Try

End Sub

but how can I get the location and hometown information since them seem to be on next level?

Should explain, this is first time I’ve looked at JSON

  • 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-27T08:48:33+00:00Added an answer on May 27, 2026 at 8:48 am
    1. Convert the JSONObject to a JSONArray. These classes are available in Facebook C# SDK if you are using it.
    2. Iterate the array items one by one to extract the top level items.
    3. Put a check in the loop –

    if(arr[i] is JSONArray)
    {
    //this is an array and NOT an object of key-value pair. Need to iterate it furthur
    }

    1. Keep on filling the data items you fetch into a Datatable or something similar.

    2. I would recommend you to write a recursive function for this algorithm.

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

Sidebar

Related Questions

I'm getting this json string info from the server : {members:[[sd2840d,Johny],[jkld341,Marry]]} So I store
I'm getting back from a library what looks to be an incorrect unicode string:
I'm getting a string similar to the following back from the database: The object
I'm getting a string back from my page and I want to make sure
I am getting back a string[] from a 3rd party library. I want to
I am getting xml in a object back from a soap service. <data><name>Test</name><name>Test</name><name>Test</name></data> I
I'm receiving a Json string back from a http request that looks something like
I'm doing some string replacement on text I'm getting back from a JSON web
I'm getting back a JSON string from a third party API. When I use
I am getting a string hash like this: string content = a very long

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.