# Bulk Uploading

## Uploading Users

It's possible to import new users and update existing users at once by uploading a CSV file of changes that need to be made.

1\. In the **ClearXP** admin interface, navigate to **Users** > **Bulk Upload**

![](/files/-M-cB8Oc-x0DeovhJEQy)

2\. Drag and drop a CSV file with your users and their attributes into the designated area of the page and click **Start Upload**.

{% hint style="info" %}
The import tool does not place any constraints on the names of the columns or what data appears in this CSV file since it provides the flexibility to map your data in subsequent steps. However, see the [**Sample CSV for Users**](https://help.clearlrs.com/user-guides/bulk-uploading#sample-csv-for-users) section below if you would like some additional guidance.
{% endhint %}

3\. Once the upload has completed, a screen will be displayed allowing you to map each column from your CSV file to a **ClearXP** resource, along with a preview of the first few rows of data from your CSV file.

For each column you wish to import, click the drop down and select the resource that column should be mapped to. A summary of possible values include:

| Resource             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **User Attributes**  | <p>Any configured user attributes will be listed under this resource heading. The selected attribute will be added to the user's profile and can be used to segment the user for user groups, enrolments and report generation.<br><br>If your user attribute is an email, you will receive the additional option to <strong>Send Learning Hub Invite</strong> - select this checkbox if you wish to mail out an activation email to each new user. An email will not be sent for users that already have an active account.<br></p><p>See the <a href="https://help.clearlrs.com/user-guides/bulk-uploading#importing-dates"><strong>Importing Dates</strong></a> section below if your user attribute is a date for additional formatting options.</p> |
| **Add To Group**     | Enter the name of an existing *User Group* that you wish to add the user to. The group must exist in the system already or the user will not be added.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Add To Enrolment** | Enter the name of an existing *Enrolment* that you wish to add the user to. The enrolment must exist in the system already or the user will not be added.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

![](/files/-M-cD6REF8uB87OVnoOd)

4\. Ensure you select a **Display Name** for your users. This name may be populated by a value from a single column or composed of values from multiple columns (such as **First Name** and **Last Name**) separated by a space.\
\
5\. Click **Check Mapping** to validate your configuration and see a summary of actions that will be taken. The summary screen will outline how many rows contain new users or existing users, as well as any errors or warnings that may occur when importing this file.

![](/files/-M-fxoTZfhMZPWhlLXSk)

It is advised that you review this summary screen carefully. Sometimes it is safe to ignore warnings but in other cases, it may result in corrupt data so read each warning message and use your best judgement before importing. You can always return to the mapping screen and remove a column from import if you're unsure of the consequences of importing it.

6\. When you're satisfied that the mapping is correct, click **Confirm Import** to queue the file for importing. After several minutes, this file will be imported and any new users will appear in the system.

### Sample CSV for Users

The below is an example CSV file that includes 4 users with columns for 3 different *user attributes* (**First name**, **Last name**, and **Email**) as well as a column for *adding to a group* (**Group**) and *adding to an enrolment* (**Enrolment**).

| First name | Last name | Email                      | Group         | Enrolment         |
| ---------- | --------- | -------------------------- | ------------- | ----------------- |
| Danny      | Demo      | <danny.demo@example.com>   | Test Group    |                   |
| Dan        | Demo      | <dan.demo@example.com>     | Test Group    | Demo Enrolment    |
| Sam        | Sample    | <sam.sample@example.com>   | Missing Group | Demo Enrolment    |
| Sammy      | Sample    | <sammy.sample@example.com> |               | Missing Enrolment |

{% tabs %}
{% tab title="sample-users.csv" %}

```
First name,Last name,Email,Group,Enrolment
Danny,Demo,danny.demo@example.com,Test Group,
Dan,Demo,dan.demo@example.com,Test Group,Demo Enrolment
Sam,Sample,sam.sample@example.com,Missing Group,Demo Enrolment
Sammy,Sample,sammy.sample@example.com,,Missing Enrolment
```

{% endtab %}
{% endtabs %}

## Uploading Activities

As opposed to creating multiple activities and setting values manually through the user interface, it's possible to bulk create or update activities by importing a CSV file.

1\. In the **ClearXP** admin interface, navigate to **Activities** > **Events** and click **Bulk Upload**

![](/files/-LTKjCnvPc4fH9YbgAHB)

2\. Drag and drop a CSV file with your users and their attributes into the designated area of the page and click **Start Upload**.

{% hint style="info" %}
The import tool does not place any constraints on the names of the columns or what data appears in this CSV file since it provides the flexibility to map your data in subsequent steps. However, see the [**Sample CSV for Activities**](https://help.clearlrs.com/user-guides/bulk-uploading#sample-csv-for-activities) section below if you would like some additional guidance.
{% endhint %}

3\. Once the upload has completed, a screen will be displayed allowing you to map each column from your CSV file to a **ClearXP** resource, along with a preview of the first few rows of data from your CSV file.

For each column you wish to import, click the drop down and select the resource that column should be mapped to. A summary of possible values include:

| **Resource**            | Fields                                                                                                                                                          | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Activity Fields**     | <ul><li>Name</li><li>Description</li></ul>                                                                                                                      | Generic fields that apply to all activity types.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Activity Attributes** |                                                                                                                                                                 | Any configured activity attributes will be listed under this resource heading. The selected attribute will be added to the activity and can be used when searching or in report generation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Event Fields**        | <ul><li>Enrolment Mode</li><li>Cost</li><li>Learning Objectives</li><li>Instructions</li></ul>                                                                  | <p><em>Event</em>-specific fields that will be displayed when viewing the <strong>Event Screen</strong> in the Learning Hub.</p><p></p><p><strong>Enrolment Mode</strong> must be one of <em>open</em>, <em>manager-approval</em>, or <em>closed</em>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Session Fields**      | <ul><li>Start Date/Time</li><li>End Date/Time</li><li>Time Zone</li><li>Code/Identifier</li><li>Venue Description</li><li>Places</li><li>Instructions</li></ul> | <p><em>Session</em>-specific fields that will be displayed when viewing the <strong>session Screen</strong> in the Learning Hub.</p><p></p><p>See <a href="https://help.clearlrs.com/user-guides/bulk-uploading#importing-dates"><strong>Importing Dates</strong></a> for instructions on formatting the <strong>Start Date</strong> and <strong>End Date</strong> fields.</p><p></p><p>The <strong>Time Zone</strong> must be specified in the <em>Continent/City</em> format, please see the <strong>TZ</strong> column in this <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"><strong>List of Time Zones</strong></a> for all available time zone values.</p> |
| **Session Venue**       | <ul><li>Facility</li><li>Room</li></ul>                                                                                                                         | Links the session to a **facility** and **room** venue.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Session Facilitator** |                                                                                                                                                                 | Adds a **facilitator** to the session by name or unique identifier (if configured). See the [**Multiple Resources**](https://help.clearlrs.com/user-guides/bulk-uploading#multiple-resources) section for assigning multiple facilitators at once.                                                                                                                                                                                                                                                                                                                                                                                                                                       |

![](/files/-LTKjstVW490bd54uCYv)

4\. Click **Check Mapping** to validate your configuration and see a summary of actions that will be taken. The summary screen will outline how many rows contain new users or existing users, as well as any errors or warnings that may occur when importing this file.

![This file contains references to a missing user](/files/-LTKkKhSrSqSoOyGX4lQ)

It is advised that you review this summary screen carefully. Sometimes it is safe to ignore warnings but in other cases, it may result in corrupt data so read each warning message and use your best judgement before importing. You can always return to the mapping screen and remove a column from import if you're unsure of the consequences of importing it.

5\. When you're satisfied that the mapping is correct, click **Confirm Import** to queue the file for importing. After several minutes, this file will be imported and any new activities will appear in the system.

### Sample CSV for Activities

The below is an example CSV file that includes 1 *event* and 2 *sessions* with columns for **Name**, **Event Cost**, **Session Start Date**, **Session End Date** and **Session Time Zone**.

In this example we're importing an *event* and a *session* at once, so where a column is not applicable, the value is left blank to ensure it is skipped.

| Name      | Cost | Start Date      | End Date        | Time Zone       |
| --------- | ---- | --------------- | --------------- | --------------- |
| Workshop  | 20   |                 |                 |                 |
| Session 1 |      | 12/11/18 9.00am | 12/11/18 5.00pm | Asia/Tokyo      |
| Session 2 |      | 20/11/18 6.00am | 21/11/3.30pm    | Australia/Perth |

{% tabs %}
{% tab title="sample-activities.csv" %}

```
Name,Cost,Start Date,End Date,Time Zone
Workshop,20,,,
Session 1,,12/11/18 9.00am,12/11/18 5.00pm,Asia/Tokyo
Session 2,,20/11/18 6.00am,21/11/18 3.30pm,Australia/Perth
```

{% endtab %}
{% endtabs %}

## Advanced Usage

### Importing Dates

The bulk importer for users and activities may sometimes require you to specify the format of a date you are importing. This might happen if importing a user attribute that is of the date format, or when importing a *Session* activity with a start or end date.

Because the import tool does not constrain what format dates must appear as in the CSV file, it is the responsibility of the admin to specify how the date is formatted so that it can be imported correctly.

See the below example CSV file for importing two *sessions.*

| Session Name | Start Date       | End Date         |
| ------------ | ---------------- | ---------------- |
| Session A    | 2019-01-15 09:00 | 2019-01-15 17:00 |
| Session B    | 2019-01-20 08:30 | 2019-01-21 10:00 |

{% tabs %}
{% tab title="sample-sessions.csv" %}

```
Session Name,Start Date,End Date
Session A,2019-01-15 09:00,2019-01-15 17:00
Session B,2019-01-20 08:30,2019-01-21 10:00
```

{% endtab %}
{% endtabs %}

When this file is uploaded and mapped, the import tool will request a date format for both Start Date and End Date.

![Start Date and End Date both require a Date Format](/files/-LTK_xMRcEJFjgaHgvJW)

The **Date Format** field takes a series of tokens that map to the format of the date you are trying to import. The below is a reference table for all allowed tokens:

| Token  | Example                                      | Description                                                              |
| ------ | -------------------------------------------- | ------------------------------------------------------------------------ |
| `YYYY` | `2019`                                       | 4 or 2 digit year                                                        |
| `YY`   | `19`                                         | 2 digit year                                                             |
| `M MM` | <p><code>1</code><br><code>12</code></p>     | Month number                                                             |
| `D DD` | <p><code>1</code></p><p><code>31</code></p>  | Day of month                                                             |
| `H HH` | <p><code>0</code></p><p><code>23</code></p>  | Hours (24 time)                                                          |
| `h hh` | <p><code>1</code></p><p><code>12</code></p>  | <p>Hours (12 hour time)</p><p>(Should be used with <code>a A</code>)</p> |
| `a A`  | <p><code>am</code></p><p><code>PM</code></p> | Post or ante meridiem                                                    |
| `m mm` | <p><code>0</code></p><p><code>59</code></p>  | Minutes                                                                  |
| `s ss` | <p><code>0</code></p><p><code>59</code></p>  | Seconds                                                                  |

Given this reference table, we can determine that our sample file should use the **Date Format** of `yyyy-mm-dd HH:mm` to correctly import each session:

| Row                    | Column Value     | Result                   |
| ---------------------- | ---------------- | ------------------------ |
| Session A - Start Date | 2019-01-15 09:00 | Jan 15th, 2019 at 9am    |
| Session A - End Date   | 2019-01-15 17:00 | Jan 15th, 2019 at 5pm    |
| Session B - Start Date | 2019-01-20 08:30 | Jan 20th, 2019 at 8.30am |
| Session B - End Date   | 2019-01-21 10:00 | Jan 21st, 2019 at 10am   |

{% hint style="info" %}
Note that all date and time components are *optional*, if no time is stipulated then the date will be imported at midnight. If no day is included in the format, the 1st of the month will be used, etc.
{% endhint %}

### Multiple Resources

When bulk importing users or activities, it's often desirable to link the imported entity to some other resource in the system. This may include assigning the imported user to a *Group* or *Enrolment* – the documentation above adequately covers how this can be done, however, it may not be clear that multiple resources can be assigned to a single user at once.

Take for instance, the following sample CSV for importing two *users*:

| Name         | Group 1 Name | Group 2 Name |
| ------------ | ------------ | ------------ |
| John Smith   | Sales        |              |
| Kelly Warner | Marketing    | Managers     |

{% tabs %}
{% tab title="sample-users.csv" %}

```
"Name","Group 1 Name","Group 2 Name"
"John Smith","Sales"
"Kelly Warner","Marketing","Managers"
```

{% endtab %}
{% endtabs %}

The first row contains the user **John Smith** who will be added to the group **Sales**, if it exists. The second row, however, contains the user **Kelly Warner** who will be added to both the **Marketing** and **Managers** groups.

{% hint style="info" %}
When mapping an entity to a resource, it's possible to add that user to multiple resources of that type by *creating and mapping multiple CSV columns*.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.clearxp.com/user-guides/bulk-uploading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
