Upload users in Moodle Workplace

From MoodleDocs
workplacelogo.png This feature is part of Moodle Workplace™, which is available through Moodle Certified Partners and Service Providers only.

The Upload users tool is enhanced in Moodle Workplace to allow additional functionality.

Tenant allocation

A tenant can be specified using tenant field when uploading the CSV by users with the capability tool/tenant:allocate. These users will be able to specify a tenant when uploading users (both when creating new users and updating existing).

If the current user does not have this capability, they can only create/update users in their own tenant. Use of tenant field is not allowed to these users. Note that by default, only site admins have this capability.

Example of the CSV file:

username,firstname,lastname,email,tenant
jonest,Tom,Jones,jonest@example.com,big
reznor,Trent,Reznor,reznor@example.com,small

Tenants are matched by their "ID number".

Locating tenant ID number

Set tenant admin permissions

When creating or updating users via the tenant admin tool users can be allocated to tenants. The field istenantadmin has to used to specify whether a user is tenant admin. Valid values are as follows:

  • 1: user is tenant admin
  • 0: unassigns user as a tenant admin (only in update mode)
  • No value: No changes

Job assignments

If the current user has the capability to assign jobs (in addition to the capability to use the upload user tool), they can create jobs for users or modify dates for existing jobs. Both fields jobdepartment1 and jobposition1 must have values, and fields jobstartdate1 and jobenddate1 are optional. When a user already has a job in this department and position, the dates will be modified but the new job will not be created, in this case, empty values in start/end date fields will mean "do not modify", to remove the job end date it can be set to "0". Departments and positions are matched by their "ID number" just like tenants. It is possible to add more than one job for one user in the same line by adding jobdepartment2, jobposition2, etc.

username,firstname,lastname,email,jobdepartment1,jobposition1,jobstartdate1,jobenddate1
jonest,Tom,Jones,jonest@example.com,exampledep,examplepos,,
reznor,Trent,Reznor,reznor@example.com,exampledep2,examplepos2,2019-05-07,
jon,Jon,Whatever,jon@example.com,exampledep2,examplepos2,2019-05-07,2032-01-09

To delete a job assignment, make use of the jobdelete1 field, as shown in the following example.

username,jobdepartment1,jobposition1,jobdelete1
user1,dep1,pos1,1
user2,dep1,pos1,0

When the value is set to 1, the record will be deleted; if it is set to 0 the record will be kept.

Manually assigned managers

The Moodle user upload feature has been extended to support manually assigned managers.

Creating manually assigned managers

To add manually assigned managers, two new fields have been implemented, namely manager and managerpermissions, both requiring a postfix. That way, it is possible to add multiple managers to the same user by using the column headers 'manager1', 'manager2', etc.

manager is identified by a username and must belong to the same tenant.

managerpermissions can either be specified in human-readable format or using 0-7 notation:

  • allocate = 1 (Permission to allocate managed users to programs and certifications)
  • reports = 2 (Permission to view reports on managed users)
  • notifications = 4 (Permission to receive notifications on managed users)
  • all = 7 (default if the field managerpermissions is missing from the CSV file)
  • "" = 0

To specify multiple permissions, values can be combined, for instance, "allocate, reports" (3 in 0-7 notation) or "reports, notifications" (6). Note, that combined permissions have to be surrounded by double-quotes.

username,firstname,lastname,email,manager1,managerpermissions1
manager,User,Manager,manager@example.com,0,0
userone,User,One,userone@example.com,manager,all
usertwo,User,Two,usertwo@example.com,manager,"allocate, reports"

The following rules apply:

  • If the user already has the same manually assigned manager, the assignment is skipped
  • If the user already has another manually assigned manager, the user is added as additional manager, that is, not replaced.

The Workplace user upload feature has a built-in detection to avoid circular manager relationships. If, for example, user1 is manager of user2, user2 cannot be the manager of user1. If an infringement has been detected, the following error message will be shown in the Workplace column on the Upload users results screen:

User Manager Circular.png

Updating manually assigned managers

In order to modify existing managers, the same format has to be used as for creating new ones. However, the Upload type has to be set to either Add new and update existing users or Update existing users only.

The same rules and consistency checks apply as outlined above.

Deleting manually assigned managers

To remove a manually assigned manager, the managerdelete field has to be specified, where 1=delete and 0=ignore.

username,manager1,managerdelete1
usertwo,manager,1

To replace a manager, the previous manager has to be specified, for example:

username,manager1,manager2,managerdelete2
user1,managernew,managerold,1

Programs and certifications allocations

If the current user has the capability to allocate to programs and/or certifications (in addition to the capability to use the upload user tool), they can do so in the upload users tool. Only users, programs and certifications from the same tenant can be used. If the user already has a direct (manual) allocation to a program/certification or via dynamic rules, the dates will be updated. Programs and certifications are matched by their "ID number".

Programs:

username,program1,programstartdate1,programenddate1,programduedate1
user14,prog1,2019-05-12,,
user15,prog1,2019-05-12,2032-01-09,2032-01-09
user12,prog1,2019-05-12,2032-01-09,
user13,prog1,2019-05-12,,2032-01-09

Certifications:

Example 1 - allocating users to certification and/or updating dates in the existing allocation (start and due date can not be updated for users who are already certified or have started recertifications):

username,certification1,certificationstartdate1,certificationduedate1
user14,cert1,2019-05-12,
user15,cert1,2019-05-12,2032-01-09

Example 2 - marking users as certified:

username,certification1,certificationcertify1,certificationcertifyexpires1,certificationcertifytimecertified1
user13,cert1,1,2032-01-09,2019-10-12

Example 3 - updating the expiry date for the users who are already certified:

username,certification1,certificationexpirydate1
user16,cert1,2022-01-01

Course completion

If the current user has the 'tool/datastore:uploadcoursecompletion' capability, they can upload course completion data to be stored in the Data store for users who belong to the same tenant as themselves. This data can be reported on by using the Report builder report source "Course completion from datastore".

Details on the course completion mechanism can be found in a dedicated section in the Report builder docs.