- 05 Jul 2023
- 4 minutes to read
Available fields for uploading a user
- Updated on 05 Jul 2023
- 4 minutes to read
The table below contains a list of available fields you can include in the file you use for uploading users to your site. The required fields are noted in the notes column and all other fields are optional, so you can use as many or as few of them as you wish.
The default values for many user profile fields can be set on the Upload users preview screen.
You can bulk upload users to a specific tenant using the Tenant default value if you have multitenancy enabled.
Field | Description | Notes |
---|---|---|
username | Username can only contain alphabetical lowercase letters, numbers, hyphens (-), underscores (_), periods (.), or at signs (@). | Required field. |
firstname | The user's first name. | Required field. |
lastname | The user's last name. | Required field. |
Email is in the following format: name@example.com | Required field. | |
password | The password field is optional when the Create password if needed setting is chosen (default).
| Note that if the password field is empty and new passwords are created then users will be notified by email. This could result in a very large number of emails being sent if you have a lot of users. |
maildigest | To prevent users from receiving a large number of emails from your site, use the maildigest field. The options for this field are:
| - |
country | Use a two-letter country code. | See the ISO 3166 country codes database for details. |
auth | The auth field must be used if the site uses an alternative authentication method, such as LDAP, as otherwise the authentication method will default to manual and users using a different authentication method won't be able to log in. | - |
profile_field_xxxxx | If you have custom profile fields, you can optionally include these in the upload file by entering them in the format profile_field_xxxxx, where the custom profile field name is xxxxx (i.e. the unique shortname). Ensure that you use all lowercase for the shortname. For example, if you have a custom field for department then it would be entered in the file as asprofile_field_department. If your custom field is a menu then ensure that you use one of the corresponding options in the user detail record entry. For example, the custom field department might have three options: HR, Marketing or Training. You would therefore just enter one of these into the value for the user details. username,firstname,lastname,email,profile_field_department | You must create the custom fields before importing the upload users file. |
oldusername | Used for changing of usernames. | - |
deleted | Use this to delete a user with 1, or use 0 to add a user that has been deleted. | - |
suspended | Use this to suspend a user, with 1 to suspend and 0 to unsuspend the user. | - |
course | If you have Totara Learn, you can enter multiple courses using the header 'course' and a number, e.g. course1,course2, etc. The other enrolment fields then need to use the same numerical suffix. The course field uses the course shortname as the value in the user details entry. For example: username,firstname,lastname,email,course1,group1,course2,role2 The example above would add the user Bailey Barker as follows:
| Enrolment fields should use matching suffixes, e.g. course1,group1,role1,course2,group2 |
group | If you have Totara Learn, you can assign users to groups in a course using the group name or ID (numeric group names are not supported). | Enrolment fields should use matching suffixes, e.g. course1,group1,role1,course2,group2 |
type | For Totara Learn, type sets the role to be used for the enrolment. You can use the following values:
| Enrolment fields should use matching suffixes, e.g. course1,group1,role1,course2,group2 |
role | When using Totara Learn, you can add a role in two ways:
| Enrolment fields should use matching suffixes, e.g. course1,group1,role1,course2,group2 |
enrolperiod | For Totara Learn, you can use the enrol period to set the enrolment duration, in days, for each course. | Enrolment fields should use matching suffixes, e.g. course1,group1,role1,course2,group2 |
enrolstatus | With Totara Learn, the enrolstatus can suspend users from a course when set to 1, or left blank for enrolled. | Enrolment fields should use matching suffixes, e.g. course1,group1,role1,course2,group2 |
cohort | You can use the cohort field to add audiences. This optional field uses the format: cohort1. Internal audience ID numbers or non-numeric audience IDs of existing audiences must be used. Names are not allowed. | - |
mnethostid | Existing MNetusers can be added to courses, groups, or audiences as below:
| This field is optional. |
sysrole | System role is an optional field that uses the format: sysrole1,sysrole2,sysrole3 etc. Users may be uploaded to a system role (usually Manager) by entering the shortname of that role. Other roles can only be uploaded if they have already been assigned in the system context. Find more information on the What are roles? page. Multiple roles can be assigned using sysrole2, sysrole3, etc. fields. Note that the number suffix in no way relates to the number suffixes on the enrolment fields. The numbers must go up in sequence, starting at 1. | Users can also be removed from a given system role by entering the shortname of that role prefixed with a minus symbol: '-'. If the user is currently assigned to that role, they are removed from it. If the user is not currently assigned to that system role, the field value is ignored. However, the field value must refer to a system role that does exist on the system, otherwise an error will occur. |
Optional fields | You can also enter other fields as listed below:
| If you are using the optional idnumber field then Totara will check for duplicates. |