CSV upload

This plugin is better suited for administrators and users with elevated permissions in order to obtain the correct information and due to the risk of inserting incorrect data into ResourceSpace.

The plugin allows you to edit existing resource metadata as well as to create new resources by uploading a CSV file.

Please note:If you need to process large CSV files (i.e. 1000s of rows) it is recommended that you enable offline jobs in order to avoid having to wait a long time for the CSV to process and the possibiity of browser timeouts causing the CSV upload to fail.

You can choose to: -

  • Upload resources using any method e.g via StaticSync and then update metadata using a CSV
  • Use a CSV to create the resources and then use batch replace functionality to upload the associated files
  • Download resource metadata from search results or a collection (see CSV Export), edit the data in the CSV and re-upload it to update the resources

The CSV upload process is split into steps as below

Step 1 - Select file

On this page you can:-

  • Select the CSV file to upload
  • Choose whether to create new or update existing resources
  • Select a previously saved CSV mapping configuration file to make the process quicker*
  • Clear any existing mapping configuration to upload a CSV in a new format
* Saving the configuration stores the column position, not the column name so this requires subsequent CSV files to have the columns in the same order

Step 2 - Set options

If creating new resources

  • Choose to add the new resources to the currently selected collection
  • Select the column that contains the resource type
  • Set a default resource type if no column is selected or if no valid value is found
  • Select the column that contains the workflow state (e.g. for a default installation, -2 = Pending submission, -1 = Pending review, 0 = Active, 1 = Waiting to be archived, 2 = Archived)
  • Set a default workflow state if no column is selected or if no valid workflow id is found
  • Select the column that contains the access level (0 = Open, 1 = Restricted, 2 = Confidential)
  • Set a default access level if no column is selected or if no valid access value is found

If editing existing resources it is advisable to:-

  • Limit the resources that will be updated to those in one of your collections
  • Select the column that contains the resource type. Leave unselected to keep the resource type unchanged
  • Select the column that contains the resource identifier. Normally this will be the resource ID or filename
  • Select whether you are matching on resource ID or metadata field value
  • If matching based on metadata you need to choose the action that should be taken by the system should multiple matching resources be found

Step 3 - Map CSV columns to metadata fields

On this page you define which metadata fields the CSV columns relate to. The plugin will attempt to automatically select the correct field if the column header matches the field title or shortname.
Any columns that are not required can be marked as 'DO NOT USE'.

Click 'Next' When you are happy with the mappings.

Step 4 - Checking CSV data

This is the 'dry-run' stage. ResourceSpace will process the CSV file information but without changing any data. Any errors or warnings (up to a maximum of 100) will be reported. If you want to change any data in the CSV you will need to return to step 1 and re-upload the amended file.

Click 'Process' if you are happy to proceed and the file will be processed

Step 5 - Processing CSV

ResourceSpace will process the CSV file information, creating or updating resources as required.

Click 'Process' when you are happy and the file will be processed

You now have the options of uploading another CSV file or downloading the current mapping configuration as a file so that you can use it in the future, or distribute it for use by other users who can upload CSVs in the same format.

Tips and troubleshooting

  • The CSV must have a header row
  • The CSV file should be encoded in UTF-8 format and without BOM
  • The CSV should have text cells quoted in case they contain commas or other special characters
  • All mandatory fields for the created resource types must be present
  • Date values should be in the format YYYY-MM-DD HH:MM
    e.g. 2:42 PM on the 25th March 2013 should be formatted as '2013-03-25 14:42'.
    If the date field does not include times then '2013-03-25' is correct
  • To include values for category trees the full path to the category tree item must be provided. The CSV needs to use the '/' separator to specify the full tree path. The format to use is level1,level1/level2,level1/level2/level3.