User Element

Zean

New Member
Hi
I have two forms one were users can edit data on my database with a user element that captures the user that last edited the record the problem i have is to display the user name in the second display its only showing a number and not the user name that edited the record i think its the fack that fabrik stores the userID in the database is there a way to show user name from the is in the field or to simply store the user in the database?

Thanks in advance :)
 
You can get the user name by using a Database Join element on the users table username column, using the userid as the join.
 
Thanks For the reply Nick the problem is. I have a list/form where users can update the working hours of our fleet with a hidden timestamp and hidden user element then i have a fleet list/form where i want to display that information on when last was the hours changed and by who. the time stamp worked as a text field because the timestamp saves the date in the database so i only showed the info as a unchangeable text field but if i do the same with user element it only shows the user id. so all i need is not to show the id but the user. database join also shows just the id because thats the value in the table.
Thanks Again
 
The database join element has separate Value and Label properties. The Label property is what shows in list view, so if you set that to Username you will see the full name, not the id.
 
Ahh I see but for some reason i cant select a value or label there only has select table and a " - "
 
You need to select the connection and the table (prefix_users) first. Then the value and label dropdowns should populate.
 
The user element also allows you to select which property it displays (id, name, email, etc).

Note that your Fabrik list has to be on the main site database connection in order for this to work, for either joins or user elements, otherwise it will only ever show the id.

-- hugh
 
Thanks Hugh
The table is not part of my main site so ill just move it to main for the future incase i need joins
if i select the element as user element it does not display anything and it is not set on hidden
is there a setting that im missing to display it.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top