Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: User profile fields.

User profile fields: Difference between revisions

From MoodleDocs
No edit summary
 
(26 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{Moodle 1.8}}Location: ''Administration > Users > Accounts > User profile fields''
{{Accounts}}
==Overview==


Administrators can create new user profile categories and fields in ''Administration > Site administration > Users > Accounts > User profile fields''.


In Moodle 1.8 onwards, administrators are able to create new user profile categories and fields. Profile fields may be a menu of choices, text area, text input or a checkbox (in Moodle 1.9.3 onwards) and may be required or not.
Profile fields may be a menu of choices, text area, text input or a checkbox and may be required or not.


New profile fields will appear on each user’s profile page (and on the user sign-up page in Moodle 1.9 onwards).
New profile fields will appear on each user’s profile page unless "Who is this field visible to?" is set to "Not visible" in which case only the administrator can see the field. The fields can also be displayed on the signup page if "Display on signup page?" is set to "Yes" (although note that they will never be displayed if set to "Not visible").  


For one thing, this means that U.S. users will finally be able to have valid addresses, including *states*, without which an address can be meaningless. (Which state is Springfield in?  Oh, 15 of them!)  Although it does not place the state/province next to the town & country, which is where it should appear. This means that people from the United States, Canada, Mexico, Russia, Germany, India and any other countries that are composed of states or provinces cannot enter their state or province.
You can set the order in which your custom profile fields appear under the associated profile category using the up/down arrows on the User profiles fields page.
 
To create a new profile field, select the profile field format you require from the dropdown list.
 
== Common Settings ==
 
All new fields must be given a unique Short Name and a Name (this is displayed on the profile page). You may also choose to enter a Description for the field for your own reference.
 
There are also a number of configuration options common to all custom profile field types:
 
;Is this field required?
:This option specifies whether this is a mandatory or optional field for user accounts.
 
;Is this field locked?
:This option determines whether once information is populated in this field, it cannot be edited by the user.
 
;Should the data be unique?
:If you need the information populated in your field to be unique across the system (such as an ID number) select Yes to this option and the profile page update will perform a validation check on the data entered.
 
;Display on signup page?
:Depending on the authentication method in use on your Moodle site, you may have some users creating their own accounts. If you would like this custom field to appear on the registration or signup page, select Yes.
 
;Who is this field visible to?
:Each custom field can be given one of three visibility settings:
 
:* Visible to everyone
:* Not visible
:* Visible to user
 
:The Not visible setting would typically be set by an administrator who wants to hold private data on the users. The Visible to user setting would normally be selected for a field that holds sensitive information, while the Visible to everyone setting can be used for any type of information.
 
== Specific Settings ==
 
There are also a few field type Specific Settings requiring configuration around default value and size.


'''Important'''
'''Important'''
Line 14: Line 49:
Replace 'shortname' with the actual short name used for the new profile field eg. dob. So the field should read something like profile_field_dob.  
Replace 'shortname' with the actual short name used for the new profile field eg. dob. So the field should read something like profile_field_dob.  


Also, keep in mind that the shortname must be all lower case to avoid errors when uploading users via a .csv file. This currently is not enforced when creating the shortname. See [MDL-17344] for more information.
Also, you will need to visit ''Administration > Site Administration > Users > Accounts > User Profile Fields > Create new Profile Field'' before attempting to upload a file using it. <i>Creating an upload file first with custom profile fields</i> <b>without</b> <i>creating the User Profile Fields first in Site Administration</i> <b>will result in the error <u>profile_field_shortname is not a valid field name.</u></b>


==Examples of use==
==Examples of use==
Line 20: Line 55:
*'''House System'''
*'''House System'''


Many schools have a 'House' system where students and staff are assigned to a given House. For example, a school has eight houses, named after its founders: Adderton, Coolock, Gorry, Loretto, McAuley, Mercedes, Tighe and Whitty. The site administrator can add a user profile field that offers a 'Menu of choices' to the user. A default value can also be selected. If the administrator decides to bulk upload House data for users via a .csv file, it is important to represent the above array of values as 1,2,3,4,5,6,7,8 in the file. That is to state, if a user belongs to Adderton House, the value '1' should be entered for the 'House' user profile field in the given record.
Many schools have a 'House' system where students and staff are assigned to a given House. For example, a school has eight houses, named after its founders: Adderton, Coolock, Gorry, Loretto, McAuley, Mercedes, Tighe and Whitty. The site administrator can add a user profile field that offers a 'Menu of choices' to the user. A default value can also be selected. If the administrator decides to bulk upload House data for users via a .csv file, it is important to represent the above array of values as Adderton, Coolock, Gorry, Loretto, McAuley, Mercedes, Tighe and Whitt in the file. That is to state, if a user belongs to Adderton House, the value 'Adderton' should be entered for the 'House' user profile field in the given record.
 
*'''U.S. States'''
 
This can be used to improve ambiguous postal addresses by including (for example) the State. 


*[[Birthday block]] (contributed code)
*[[Birthday block]] (contributed code)


==See also==
==Translation of custom profile fields==
The [[Multi-language content filter]] can be used to provide multilingual field labels to users. Make sure the multi-language content filter is active and applied to content and headings.


*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=106997 How can I show ID Number in the user profile form?] forum discussion
==GDPR==
GDPR stands for [https://en.wikipedia.org/wiki/General_Data_Protection_Regulation General Data Protection Regulation] and refers to the European Union regulation for data protection for all individuals within the European Union. See [https://docs.moodle.org/dev/GDPR_For_Administrators GDPR For Administrators]


[[Category:Administrator]]
==See also==
*[http://youtu.be/5x9etteuayc Custom Profile Fields]  MoodleBites video on YouTube
*[[:dev:User profile fields]] developer documentation


[[fr:Champs du profil]]
[[fr:Champs du profil]]
[[de:Profilfelder]]
[[es:Campos del perfil de usuarios]]

Latest revision as of 21:57, 10 January 2018

Overview

Administrators can create new user profile categories and fields in Administration > Site administration > Users > Accounts > User profile fields.

Profile fields may be a menu of choices, text area, text input or a checkbox and may be required or not.

New profile fields will appear on each user’s profile page unless "Who is this field visible to?" is set to "Not visible" in which case only the administrator can see the field. The fields can also be displayed on the signup page if "Display on signup page?" is set to "Yes" (although note that they will never be displayed if set to "Not visible").

You can set the order in which your custom profile fields appear under the associated profile category using the up/down arrows on the User profiles fields page.

To create a new profile field, select the profile field format you require from the dropdown list.

Common Settings

All new fields must be given a unique Short Name and a Name (this is displayed on the profile page). You may also choose to enter a Description for the field for your own reference.

There are also a number of configuration options common to all custom profile field types:

Is this field required?
This option specifies whether this is a mandatory or optional field for user accounts.
Is this field locked?
This option determines whether once information is populated in this field, it cannot be edited by the user.
Should the data be unique?
If you need the information populated in your field to be unique across the system (such as an ID number) select Yes to this option and the profile page update will perform a validation check on the data entered.
Display on signup page?
Depending on the authentication method in use on your Moodle site, you may have some users creating their own accounts. If you would like this custom field to appear on the registration or signup page, select Yes.
Who is this field visible to?
Each custom field can be given one of three visibility settings:
  • Visible to everyone
  • Not visible
  • Visible to user
The Not visible setting would typically be set by an administrator who wants to hold private data on the users. The Visible to user setting would normally be selected for a field that holds sensitive information, while the Visible to everyone setting can be used for any type of information.

Specific Settings

There are also a few field type Specific Settings requiring configuration around default value and size.

Important

If the site administrator bulk uploads user data via .csv file, it is essential to use the correct convention to represent the new profile field. The convention is profile_field_shortname

Replace 'shortname' with the actual short name used for the new profile field eg. dob. So the field should read something like profile_field_dob.

Also, you will need to visit Administration > Site Administration > Users > Accounts > User Profile Fields > Create new Profile Field before attempting to upload a file using it. Creating an upload file first with custom profile fields without creating the User Profile Fields first in Site Administration will result in the error profile_field_shortname is not a valid field name.

Examples of use

  • House System

Many schools have a 'House' system where students and staff are assigned to a given House. For example, a school has eight houses, named after its founders: Adderton, Coolock, Gorry, Loretto, McAuley, Mercedes, Tighe and Whitty. The site administrator can add a user profile field that offers a 'Menu of choices' to the user. A default value can also be selected. If the administrator decides to bulk upload House data for users via a .csv file, it is important to represent the above array of values as Adderton, Coolock, Gorry, Loretto, McAuley, Mercedes, Tighe and Whitt in the file. That is to state, if a user belongs to Adderton House, the value 'Adderton' should be entered for the 'House' user profile field in the given record.

  • U.S. States

This can be used to improve ambiguous postal addresses by including (for example) the State.

Translation of custom profile fields

The Multi-language content filter can be used to provide multilingual field labels to users. Make sure the multi-language content filter is active and applied to content and headings.

GDPR

GDPR stands for General Data Protection Regulation and refers to the European Union regulation for data protection for all individuals within the European Union. See GDPR For Administrators

See also