Multiple audiences can be uploaded from a CSV (comma separated values) text file by an administrator if they go to Site administration > Users > Accounts > Audiences > Upload audiences from the Administration block. You can create an audience at either the site-wide (system) context or in the course category context.
Upload audience process
To upload an audience follow these steps:
- Create audience CSV text file for uploading (must include a name column with the name of each new audience on a new line).
- Go to Site administration > Users > Accounts > Audiences > Upload audiences from the Administration block.
- Add file to upload and configure the settings.
- Click the Preview button to review settings and check for any errors. If errors are reported with the file, correct as needed.
- When you are happy click Upload audiences.
- This will then display a confirmation screen, click Continue to complete the process.
Settings
Settings | Description | Notes |
---|---|---|
File | Click Choose a file.. to browse for the file you wish to upload or simply drag and drop it into the upload area. | - |
CSV delimiter | Choose which character you wish to use as a delimiter, by default this is a comma. The delimiter separates items on the same line like columns in a row. Choose from:
| - |
Encoding | Choose the character encoding you wish to use. The default is UTF-8. | - |
Default context | Set the default context for the audience either System (site-wide) or a particular category on the site. | The default context will be used when no contextid (or one of the available fields to lookup the contextid ) is provided. |
File format
When uploading to the site the file formatting is very important to ensure a successful upload. You can use either a spreadsheet program or a plain text editor to create the file - but it must be saved as a CSV.
The file will contain a heading row of the various fields you wish to include and then a number of rows with the audience data. The delimiter that you choose will act as the column separator when the file is saved as a CSV or opened in a text editor.
Example
Below is an example of the construction of an audience upload file using a comma as the delimiter.
name,idnumber,visible
Wellington office,123,1
Brighton office,124,1
Remote workers,1235,0
Available fields
There are a number of available fields, some are required and others are optional. You can see them all below.
Required fields
Field name | Description |
---|---|
name | The name of the audience. |
Optional fields
To provide values other than the default include one or more of the following optional fields.
Field name | Description |
---|---|
contextid | If you wish to specify the context ID for the audience you are uploading, this might be the context ID of a specific course category. |
idnumber | Assign a unique alphanumeric ID to the audience. |
description | You can provide a description of the audience, which may guide others in using it. |
descriptionformat | Specify the text editor formatting type you'd like to use for the description. Choose from:
|
visible | You can either set the audience to:
|
Additional fields
You can use additional fields to link to information elsewhere on the system. As most of the additional fields involve looking up information from other parts of the system it is advised these are used with caution.
Field name | Description |
---|---|
context | Enter the context of the audience being uploaded for example system for a site-wide audience. |
category | Associates the audience with a particular course category named here. |
category_id | Associates the audience with a particular course category using that category's ID. |
category_idnumber | Associates the audience with a particular course category using that category's ID number. |
category_path | Associates the audience with a particular course category using that category's path. |
The Totara Academy has a whole course dedicated to using Audiences in Totara Learn. Here you can learn more on how to use audiences, see best practice, and give it a go yourself.