Quite often, collections can contain a lot of content, while collection items can be manually created or added from EasyForm submissions, it can be much easier and faster to import this content as well. This article will take a closer look at
- Mapping content from a .csv file to your Stacks collection
- How to import your collection items
- Adding or edited items with a new import
- Why imports might fail
- Ensure the collection has been created
- Add/Update the collection’s labels
- Map the fields of your collection to the columns in your .csv file
- Ensure the CSV file is saved in UTF-8 format
Field Mapping
After creating the collection and adding/updating the labels, the next step is to map the fields in your collection to the column(s) of data in the .csv file you will be using to import the content.
- From the Dashboard, click the Collections tile
- Find the collection to import your content to by
- Browsing the list; or
- Searching the list by collection name
- Once found, under the Operations column, click the drop-down arrow, then click Import
- Click the Import menu tab near the top of the screen, then the Settings tab just below
- Click the menu options on the left to configure the import
-
Regular Fields (including Generic fields)
- From the drop-down for each field, select the corresponding column letter on the .csv file
-
Filter Vocabulary Fields
- From the drop-down for each filter vocabulary field, select the corresponding column letter on the .csv file
- Note: for any unused fields, leave the drop-down selected as -None
-
Link & Button Fields
- From the drop-down, select the corresponding column letter on the .csv file
- Important! If you import both links and buttons, be sure to review the delimiters in Extra settings section (described below)
-
File Fields
- From the drop-down, select the corresponding column letter on the .csv file
- Important! Files must be uploaded to Stacks separately, the associated column in your .csv file should only contain the names of the files that were uploaded. This will then map the already uploaded file to the appropriate collection item
- Important! Stacks supports file sizes upto 64MB per file, excessive amounts of files can affect site performance. If your collection contains a large amount of files, we strongly recommended these files be stored outside of Stacks, and use the Link or Button options described above as an alternative option for users/patrons to access this content
-
Extra Settings
- If needed, update the appropriate delimiter that was used in the .csv file to identify separate values when there are multiple links, buttons, and/or terms in a single column
- Tip! Your choice of delimiter may differ based on the language or region settings of the device used to create the .csv file
-
Regular Fields (including Generic fields)
- Click Save Configuration when finished
- Find the collection to import your content to by
Importing the .csv file
Before importing the .csv file, first ensure you save a copy in the UTF-8 format; this is the format required to complete the import.
- From the Dashboard, click the Collections tile
- Find the collection to import items to by
- Browsing the list; or
- Searching the list by collection name
- Once found, under the Operations column, click the drop-down arrow, then click Import
- Click + Add import, complete the fields:
-
Title, add a title for the import, this is used for internal reference
- It is recommend to use something that will allow administrators to easily identify the import should it need to be rolled back later
-
File
- Click Choose File, then browse to and select the .csv file (in the UTF-8 format)
-
Delimiter, select the character that is used to delimit fields in the .csv file (described in the mapping section above)
- Many regions use a comma; however, there may be cases where your language or region uses a different character, for example, Germany uses a semi-colon
-
No Headers, check this box if your .csv file does not contain a header row
- Tip! It is recommended that all .csv files contain a header row for easy reference and management of the file
-
Title, add a title for the import, this is used for internal reference
- Click Save and Import
-
Important! Do not navigate away from the page that displays the progress bar
- As the Import progresses:
- The title will be checked against all existing collection items, if there is an exact match, the collection item in the .csv file will be skipped
- The progress bar will indicate the activity for each collection item; it is normal to see the progress bar completing and restarting multiple times
- Once complete, you will see a message indicating the import was successful; or if an error occurred, information about the failed import will be provided
- As the Import progresses:
-
Important! Do not navigate away from the page that displays the progress bar
Adding or Editing Items with a new Import
It is possible to update an existing collection by adding new items or editing the details of existing items by importing a new .csv file. To do so, follow the steps in the Importing the .csv file section above.
A couple of items to note when performing this function:
- Items in the new import spreadsheet that do not currently exist in the collection will be added to the collection
- To update the details of an existing collection item, it must have the exact same Title on the new import spreadsheet; any other information can be different and will be updated upon import
- If the Title differs, the item will be added as a new item
- Items that are an exact match in both the existing collection and new import spreadsheet are not duplicated, these will be skipped
- If an existing collection item is not on the new import spreadsheet, it is not deleted. See the Manually Creating, Editing and Deleting Collection Items article for information on deleting collection items
Why Imports Might Fail
If your import failed, there could be a few reasons for this, the most common being
- Navigating away from the progress bar page when the file is importing
- Exceeded the maximum file size; ensure your import file is less than 64MB
- Your data contains invalid characters, review the .csv file content and update if needed
- Be cautions with the characters used in any data to ensure it isn't also being used as a delimiter!
- The mapping is incorrect, review the mapping to ensure the fields/columns match
- The delimiters are incorrect, review the .csv file to ensure the delimiters match the configuration
If your you import was successful, but you find errors in the items that have been imported or wish to rollback the import for whatever reason, refer to the Rollingback a Collection Import article.