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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:06:22+00:00 2026-06-13T12:06:22+00:00

A webservice returns this JSON below [ { companyuserId: 2, name: mike jones, superiorname:

  • 0

A webservice returns this JSON below

[
  {
"companyuserId": "2",
"name": "mike jones",
"superiorname": null,
"departmentId": "26",
"departmentname": "Design",
"companyId": "06",
"UDID": "8df912053a16ab2b4c66a",
"isActive": "1",
"devicetoken": "e8a4c1fad76b45d918f6745bfe60d32a81504",
"email": "mike@yahoo.co.uk",
"phone": "5456465465654"
  }
 ]

Thought it would be straight forward

            name = data.name;
            phone = data.phone;
            email = data.email;
            departmentname = data.departmentname;
            companyId = data.companyId;

But I’m getting undefined, How else can I do this? I think maybe the data maybe in string format because when I alert data I get the result as pasted above rather than 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-13T12:06:23+00:00Added an answer on June 13, 2026 at 12:06 pm

    That is an array of Objects.. And the Object is the First item inside an array.. So you need to use the index to access the object inside it..

    So instead of name = data.name; try this name = data[0].name;

                name = data[0].name;
                phone = data[0].phone;
                email = data[0].email;
                departmentname = data[0].departmentname;
                companyId = data[0].companyId;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Coldfusion Webservice that returns json data like below: {rows:[{cell:[43,USA,jon,doe,doe@gmail.com,HR],id:43}, {cell:[44,JAPAN,tanaka,yidi,yidi@aol.com,IT],id:44}], page:1,records:2,total:1}
I have a PHP Webservice that returns a JSON string with this format: [{latitud:37.995914,longitud:-1.139705,nombre:Miguel
I am calling a webservice which returns me a name value pair xmlarraylist ,
I have this url which is JSON webservice http://ws.geonames.org/weatherJSON?north=90&south=-9.9&east=-22.4&west=55.2 I need to write a
I am stuck in this problem, I am calling a webService that returns me
This piece of javascript always returns null in firefox & chrome, but works fine
I am calling a webservice using jQuery/AJAX which returns a string array (string[]). This
I have a web service which returns a list of JSON Objects...such as below:
Why does this simple web service refuse to return JSON to the client? Here
I have a web service that returns this string via the jQuery $.ajax() call

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.