× Joomla Facebook Connect support forum

Topic-icon Community Builder Facebook field mapping how to add more?

Support Specialist
Beth,
In the most recent v3.1, we add a bunch of new fields and refined what we're able to import. Unfortunately, not every field that you see in a user's Facebook profile is able to be imported. Facebook does some shorthand on its site so that a user can enter a zip code, and it will look up the user's location from that. However, all it will let us/JFBConnect import is that location that it determines.

You can see a full listing of the fields we can import from the link below. If you search for "location", you'll see that what it returns is:

A JSON object containing name and id

Regardless of what a JSON object is, the important part is that it only returns the users location in a city, state format and Facebook's internal ID for that location (which doesn't have much value).
developers.facebook.com/docs/reference/api/user/

Sorry for the inconvenience, and if there's a way we can improve this, or if you know of a site that's doing things differently, let us know. There are tools out there to look up zip codes based on a city/state location. That's about the best option I can suggest for you to get the user's zip code.

For your information, long ago in the 2.x series of JFBConnect we actually could get the zip code, but Facebook changed that functionality back in July.

Hope this helps, and if there's anything we can do, let us know.
The topic has been locked.
Active Subscriptions:

None
13 years 2 months ago #7509 by Beth
Hi Alzander!

Thanks for helping me on my other post earlier this evening...and now I find you've been able to support me here too!

On this point:

alzander wrote: Facebook does some shorthand on its site so that a user can enter a zip code, and it will look up the user's location from that. However, all it will let us/JFBConnect import is that location that it determines.

City/state of a user would be sufficient for my current needs...
Do you know what the variables are within the FB coding that equate to location? If its comma separated, maybe there is a way I can separate it post-mapping without too much hassle...
or
If I require zip and/or city, state on the Community Builder registration end, would it also still be required for Facebook registrants? Not that I want to give them another box to fill in, but if I can ensure their ability to participate in some of the mapping items I'll be utilizing on the site, it will be worth it. Users being able to represent where they are from is a big part of the concept/psych-build of the site.

Thanks for the link to the JSON list too!
Beth
The topic has been locked.
Support Specialist
No problem about helping you, it's what we do. Thank you for subscribing!

The Current Location field, return a value like "Albany, New York". I'm pretty sure I can give you a few lines of code that would be able to add City and State as separate fields to import from Facebook, if you'd like that (not guaranteeing it'd be that easy, but I think so). The alternative is to do what you say and parse out the value after you get the whole thing.. but that gets uglier because then you also have to hard-code the fields it goes into.

Requiring the zip for CB, right now, would actually cause some problems. CB is a little annoying in that if we (JFBConnect) create a user and try to save it with a blank value that's marked as required, CB will not save that user. Therefore, if you mark zip as required, but don't import anything into it, the CB user won't be created at all (no profile, not activated, very annoying). We're working on the 3.2 release now, and one of the goals (though still under investigation) is to have an option to add any required fields from CB, that aren't being imported into automatically, to the Registration page of JFBConnect. You'd have to use the Full Joomla User option, and we're still ironing out some details, but are optimistic this will be in the 3.2 release.

Hope this helps, but if you have any other questions, suggestions, or issues, definitely let us know!
The topic has been locked.
Active Subscriptions:

None
13 years 2 months ago #7598 by Beth
Hi Alzander,

If its not too much trouble, I'd like to take you up on your offer of code to separate city and state. I've had to put an extra call to action throughout my site, encouraging folks to go into their profile and input their state and zip to make sure they appear on the user representative map I've input. It's an extra step for them and I'd prefer it to be instantaneous, if can be.

I understand what you're saying about making the zipcode a required field and that will make it so new facebook registrants aren't saved and, as you know, this isn't an option;)

Thanks,
Beth
The topic has been locked.
Support Specialist
Beth,
I'm looking into this. I'm hoping to be able to get you a solution this weekend that will split the fields out.

Thanks for your patience,
Alex
The topic has been locked.