Fill name and email of current user

How to auto-fill form fields with Joomla user data and Community Builder custom fields.

Overview

The issue occurs when trying to populate form fields with data from the Joomla user table and custom fields from Community Builder.
For Joomla user fields, use placeholders like {user:name} in the field's Value setting. For Community Builder custom fields, add a Read Data action to query the profile table using the user ID, then reference the returned data with a {var:} placeholder in the field value.

Answered
Ca Carmiel 21 Apr, 2017
Hi dears,
I just discover Chronoforms (using V6 on Joomla V3.6-5) and try to something very simple (should be), fill 2 fields, name and email of current connected user (both are #__users table fields).
I read a lot of code suggested, FAQ and so on, but none work.
For sure I do something wrong, but unable to understand what.

I would appreciate if one of you can tell me step by step how to do it (or upload hard copy of an example).
If you speak french I would prefer, to be sure to understand all ;-)

Thank's a lot
Max_admin Max_admin 22 Apr, 2017
Answer
Hi Carmiel,

In your field "Value" box under the "Designer", just use this code:

{user:name} or {user:email}

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Ca Carmiel 22 Apr, 2017
1 Likes
Hi,
thank's a lot, it was so simple.
It work perfectly
Have a nice day
Ca Carmiel 22 Apr, 2017
Hi again,
I have another question, if I want to fill a form field with a custom field of Community Builder user table (my field is called 'cb_ao_numcarte' in #__comprofiler), what should be the simple method ?

Thank's for help
Max_admin Max_admin 22 Apr, 2017
Hi Carmiel,

There is no simple method for this one, you will need a "Read data" action to load the record of the logged in use.

#1- Events > Database > Read data > set model name to "Profile", select the table, in the conditions use
user_id:{user:id}

Then set the select type to "first matching".
This action should be ABOVE the display section.
#2- in your field value: {var:read_data_name.Profile.field_name}
Where "read_data_name" is the action name in black label.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Ca Carmiel 22 Apr, 2017
1 Likes
Ouaouh, it work perfectly.

Thank's a lot
Best regards
Roland
This topic is locked and no more replies can be posted.