An example that uses RSForm!Pro - Joomla! User Registration plugin and the built-in mappings functionality to associate data within the Joomla! User Profile table while also creating the Community Builder user entry.
IntroductionFor a while now, RSForm!Pro provides a Joomla! User Registration plugin, which as suggested, can be used to create your very own Joomla! user registration form.
Using the built-in mappings feature we can extend the form's functionality even further by assigning additional data within the standard Joomla! User Profile related table as well as within third party extensions such as Community Builder.
Before starting off, you'll have to firstly create a registration form. Once this is completed and functional, mappings are specified as instructed below.
Joomla! User Profile MappingNavigate to backend > Components > RSForm!Pro > Manage Forms > your form > Properties > Mappings and follow these steps:
The example assumes you have an extra field in your form named phone and that you want it to be associated with the according user profile data.
- Click on the 'New Query' button.
- Set 'Connection type' to "Local".
- Set 'Method' to "Insert".
- Click on the 'Connect to database' button.
- From the 'Database table' dropdown select "#__user_profiles". (`#` would be your Database Tables Prefix)
- Set 'user_id (int)' to {global:userid}. (this is a global placeholder and it will be replaced with the newly created user ID)
- Set 'profile_key (varchar)' to profile.phone. (this would be the profile_key to which we associate the submitted value. A full list of these keys can be found below.)
- Set 'profile_value (text)' to "{phone:value}". (this is the placeholder of our phone field that will return the submitted value.)
Repeat the same procedure for any other User Profile information you would like to map.
'profile_key' | Usage |
---|---|
profile.website | Website |
profile.region | Region |
profile.postal_code | Postal/ZIP Code |
profile.phone | Phone |
profile.favoritebook | Favourite Book |
profile.dob | Date of Birth |
profile.country | Country |
profile.city | City |
profile.address1 | Address 1 |
profile.address2 | Address 2 |
profile.aboutme | About Me |
Navigate to backend > Components > RSForm!Pro > Manage Forms > your form > Properties > Mappings and follow these steps:
The example assumes you want to create the user entry within Community Builder and that you have an extra field in your form named phone which you wish to also be associated with a Community Builder custom field.
- Click on the 'New Query' button.
- Set 'Connection type' to "Local".
- Set 'Method' to "Insert".
- Click on the 'Connect to database' button.
- From the 'Database table' dropdown select "#__comprofiler". (`#` would be your Database Tables Prefix)
- Set 'id (int)' to {global:userid}. (this is a global placeholder and it will be replaced with the newly created user ID)
- Set 'user_id (int)' to {global:userid}.
- Set 'cb_customfieldname (varchar)' to {phone:value}. (this is the placeholder of our phone field that will return the submitted value.)
the last step, cb_customfieldname, would be the exact name that Community Builder has generated (you can find this by editing your Community Builder custom field, within the 'Name' textbox).
- in order to map data to more custom fields, only repeat the last step.
After the form is submitted, the user account that has just been created will also be associated with Community Builder along with the custom field information.
Your Involvement MattersIf there's anything you think that should be implemented in future releases, be it a brand-new feature or an improvement for an existing one, don't hesitate to tell us about it!
Community Builder Data Fill
Is there a way to use pre-existing Community Building data to pre-populate fields in RSForm?
Quote@Brady
If you submit a support ticket about this, i am sure that our staff members will provide some assistance with this.
Quoteid insertion
I'm trying to connect to my Community Builder database. I've tried using the {global:userid} placeholder for `id` and `user_id`. I've also tried using {last_insert_id } since it's the first option to select when I click on the id field. Neither seem to work for me.
Quote