New fields Joomla

Maxvl 31 Jul, 2017

In the latest versions of Joomla, you can add additional fields to the user profile.
The values of the added fields can not be displayed using {user: USER_PARAM}

New fields and their values stored in a table ххх_fields_values

Please tell me how to customize autocomplete fields with values from the new user field?

Thank you
GreyHead 31 Jul, 2017
Hi Maxvl,

I believe that you would need to read the user_fields_values tables to get the values saved for a particular user ID. Then they will be available in the form data as usual.

Maxvl 02 Aug, 2017
Hi, Bob!

Added Read Data and specified the table xxx_fields_values. Restricted to user.
The result displays all the values by user.

How to limit also on id (field_id = 3)?

Thank you
GreyHead 02 Aug, 2017
Hi Maxvl ,

I'm sorry but I don't understand your question: "How to limit also on id (field_id = 3)?"

Maxvl 02 Aug, 2017
xxx_fields_values is composed:

• field_id - new field number
• item_id - this is user id
• value - new field values

The data is output on the field item_id

Need to display data for new field - field_id = 3

What you need to specify for the output to be on field_id = 3?
healyhatman 09 Aug, 2017
If your model name in your read data action is called GetField, then:

Under Filtering settings->Where conditions you put GetField.item_id{user:id} which would give you the record matching the current user's id.

Under Data settings->Fields to retrieve you put GetField.field_id (or whatever the name of the field is whose value you want)

Then to use it I guess it would be {var:GetField} or something I don't know.
healyhatman 14 Aug, 2017
Just for everyone who might want to know. To SAVE data into one of the new User->fields

First you need the ID of the field. In the Joomla backend go Users->Fields. All the fields you added should be listed, with the ID on the far right.

On your form, under setup, put in a Save Data action wherever you need it to go.

Model name: Doesn't matter, put whatever
Database table: (your prefix)_fields_values
Data provider: {data:} (Or {session:multipage} if you need values from an earlier page of a multipage form, might not let you get the user id then I don't know)
Data override on Insert:
field_id:(the id from earlier)
value:{source:field} e.g. {data:fieldname} or {session:multipage.fieldname} or {var:functionname}
Data override on Update: value:{source:field}
Update conditions: item_id:{user:id} this says "update the records where the item_id matches the current user's id"

UNTICK "Auto manage the data table" and "Auto save fields"
Maxvl 18 Aug, 2017
Thank you
This topic is locked and no more replies can be posted.