Export data from a View

What is View Data Export?

View data export is a module that allows you to export the data from a View into a CSV, XML and other data types. The module is disabled by default and can be enabled by a Site Builder, or you can request we enable it for you via the Service Request Form.

Overview

Once the module is enabled, it creates an option that can be added to an already existing View you have access to in your Views list. You'll have the ability to use the Add button to create a new Display mode specific to the export function and you'll tie that display mode to your View. Once complete, your live page will show a button at the bottom of the page that can be clicked to initiate the download process.

Add Data Export to your View

Assign a path under "Data Export Settings", then click on "Attach To" and attach it to the display that you created first (probably called "Page"), this is very important as it will render the button at the bottom of the first view, this way you can export whatever result you filter. You have the option to turn on batch export, for large datasets

  1. Navigate to Manage » Structure » Views or go to an existing View and use its contextual menu to select Edit View.
  2. Locate and Edit your View.
  3. Click the + Add button and select the Data export option.
    Add new export display mode
  4. When your new Display mode is added, these are the fields you will need to update:
    You will need to update specific fields in the Export display in order for your export/download option to work.
    • 1. Format: Click on the Settings link to select what file type your download will use:
      Select your preferred file format type from the available list.
    • 2. Fields: Review and, if necessary, adjust or remove the list of desired Fields to be included in the CSV-file to the 'Data Export' display, for example, fields with a lot of content like 'Body' may need to be trimmed or removed entirely.  
    • 3. Path SettingsEnsure that the 'path' for the data export is a file, with an extension matching the format. ie: /export/foo.csv . Otherwise, the file will be downloaded without a file association.
      File path and filename details
    • 4. Attach to: Pick which display modes will use your export feature. You must select at least one and Page or Block will be your most likely choices.
      Select which display modes will use the export data feature.
  5. Additional Tips:
    • In the Data Export Display mode, ensure that the 'pager' settings located under the Advanced tab are set to 'display all items' for the data export. Otherwise, the results will be limited to the number per page in the pager settings.
    • To not show all nodes by default, update 'Advanced » Exposed form > Exposed form style' from 'Basic' to 'Input required'.
  6. Scroll to the bottom of the configuration area and click Save to finish.
  7. When you visit your page, you should now see a button icon, the file type noted in its display:
    The view export file download button that shows the CSV file type of the file to be download.