Hi Prafulla, Make use of the Environment.supportsField to ensure these fields are supported by the Container. This is the link to the document describing the api - http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.Environment.supportsField
Thanks, Rohit On Jun 23, 10:37 am, prafulla <[EMAIL PROTECTED]> wrote: > Hi, > > I am able to get the Name field using Opensocial.Person.Field.Name. > After fiddling around a bit, I was able to convert this name object > into a string by using obj["_fields"]["unstructured"] . I used > gadgets.json.stringify() to study the structure of the name object. > However, I am not able to retrieve the FAMILY NAME and GIVEN NAME from > this Name object. Is it possible to retrieve the FAMILY NAME and GIVEN > NAME? If yes, how ?? > > Thanks, > Prafulla > > On Jun 19, 10:46 pm, Zach <[EMAIL PROTECTED]> wrote: > > > Thanks for the help, I believe I'm on the right track now. > > > On Jun 19, 12:13 pm, Zach <[EMAIL PROTECTED]> wrote: > > > > Thank you for the reply. Unfortunately, I'm still a little confused. > > > When I get the NAME field back it outputs [object Object]. This might > > > be a dense question, but how do I get the actual name out of this > > > object that's coming back? I've tried toString and other methods, but > > > I'm about out of ideas. > > > > On Jun 19, 10:45 am, Aakash Bapna <[EMAIL PROTECTED]> wrote: > > > > > Hi Zach, > > > > > first of all you forgot to add the params variable to your request. > > > > req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER,params),'owner'); > > > > you can get the ID of the person just by owner.getId()To know more on > > > > what fields you have access to check > > > > outhttp://docs.google.com/Present?docid=dd5dv8xk_11dz8824x7 > > > > Thanks ~Aakashhttp://aakash-bapna.blogspot.com > > > > > > Date: Thu, 19 Jun 2008 05:58:32 -0700> Subject: [OpenSocial] Null > > > > > fields> From: [EMAIL PROTECTED]> To: [email protected]> > > > > > > > Wondering if anybody might be able to show me where I'm screwing > > > > > up> here. Everything I get back using getField() is either null or> > > > > > undefined. The only thing that seems to work is getDisplayName().> > > > > > > gadgets.util.registerOnLoadHandler(init);> > function loadFriends() > > > > > {> > var req = opensocial.newDataRequest();> var params = {};> > > > > > params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS]=> > > > > > [opensocial.Person.Field.ID,> opensocial.Person.Field.NAME,> > > > > > opensocial.Person.Field.GENDER,> opensocial.Person.Field.REGION];> > > > > > > > > > > > > > req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER),> > > > > > 'owner');> > > > > > > > req.add(req.newFetchPeopleRequest(opensocial.DataRequest.Group.OWNER_FRIENDS,> > > > > > params), 'ownerFriends');> req.send(onLoadFriends);> > }> > function > > > > > onLoadFriends(data) {> > var owner = data.get('owner').getData();> > > > > > var ownerFriends = data.get('ownerFriends').getData();> var content = > > > > > document.getElementById('content');> var username = > > > > > document.createElement('div');> var userbody = > > > > > document.createElement('div');> var userleft = > > > > > document.createElement('div');> var userright = > > > > > document.createElement('div');> var name = owner.getField( > > > > > opensocial.Person.Field.NAME );> alert(name);> > > > > > > username.setAttribute("class", "username");> > > > > > username.setAttribute("className", "username");> > > > > > userbody.setAttribute("class", "userbody");> > > > > > userbody.setAttribute("className", "userbody");> > > > > > userleft.setAttribute("class", "userleft");> > > > > > userleft.setAttribute("className", "userleft");> > > > > > userright.setAttribute("class", "userright");> > > > > > userright.setAttribute("className", "userright");> > > > > > > username.innerHTML = owner.getDisplayName() + "<hr>";> > > > > > > userleft.innerHTML = "<b>Name:<br>Location:<br>Email:<br><br>General> > > > > > Info:<br></b>";> userright.innerHTML = > > > > > owner.getField(opensocial.Person.Field.NAME) +> "<br>";> > > > > > > alert(owner.getField(opensocial.Person.Field.ID));> alert("Name: " + > > > > > owner.getField(opensocial.Person.Field.NAME));> > > > > > alert(owner.getField(opensocial.Person.Field.ABOUT_ME));> > > > > > > userbody.appendChild(userleft);> userbody.appendChild(userright);> > > > > > content.appendChild(username);> content.appendChild(userbody);> > }> > > > > > > function init() {> loadFriends();> }> > Fairly bumfuzzled,> -Zach> > > > > > _________________________________________________________________ > > > > > Introducing Live Search cashback . It's search that pays you > > > > back!http://search.live.com/cashback/?&pkw=form=MIJAAF/publ=HMTGL/crea=int... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "OpenSocial Application Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-api?hl=en -~----------~----~----~----~------~----~------~--~---
