Export Data to CSV

Updated a few days ago

3 min read

Overview

 

This automatic action creates aggregate, table-format information about files that went through the workflow by creating one CSV (comma-separated values) row for each file processed by the workflow. For example, it can store information about all invoices that went through the Process Invoices workflow for each month, so the invoice data (e.g. Invoice ID, total amount to pay, bank account number - one invoice per row) is stored in the Excel file and can be sent for payment at the end of the month.

 

Rules

 

  • This action acts, in a way, as a report of files that went through the workflow. That report is stored in a separate file in the chosen location.
  • File Name specifies the name of the exported CSV file.
    • The file name may include dynamic metadata variables such as the invoice month or year
    • An important thing here is that the file name determines how the processed files' info will be grouped. For every file processed by the workflow, exported with the same name, the CSV row will be appended to the already existing file.
      • For example, if the file name is set to be “Invoices [Year]” (year being metadata invoice year), it means that the system will create the “Invoices 2025” file for all invoices from 2025, 
        “Invoices 2026” for all invoices from 2026, etc.
      • If the file name is not dynamic, let's say just “Invoices” static text, that means that a single CSV file will have all the data ever processed in the workflow collected in a single file.
    • Export Data to CSV action functions this way:
      • It calculates the file name by replacing dynamic variables with their values
      • If the file with that name doesn't exist in the specified location, it creates it and appends the first row to it
      • If the file already exists, it just appends the CSV row to it
    • Maximum number of characters for a new file name is 100
    • Characters : “ # % * : < > ? / \ | ~ & ゛ဧ $ are forbidden when you try to put them directly in the text field for New file name. If you use metadata value for New file name, then the aforementioned characters are replaced with “-” because Windows doesn't allow using them in file names.
    • Enter character is replaced with space
    • Day and month metadata are padded with leading 0 if needed (like 08, 09, 10)
  • CSV Columns let the user specify which columns the CSV row will have.
    • Columns are typically picked from the metadata, so they have values dependent on the processed file (e.g. Invoice ID, Total Amount). This can easily be achieved through the Simple mode of the CSV Columns control on the interface.
    • Simple mode lets users just pick columns from existing metadata without any customisations
    • For advanced fine-tuning, users can use Advanced editing mode, which lets them change:
      • The column name to any text
      • The column value to any combination of static text and metadata variables
      • Order of columns
      • Add/remove a column at any place in the list of columns
      • Maximum number of characters for column name and column value is 100
    • The top row of the CSV report will always be the header with column names
    • The CSV column value in Advanced editing mode may be empty
      • We do that because some software we will communicate with (by exporting CSV to them) will require certain fields we can't provide, but they will still require them in their desired format. So, we let our users send blank values in that case.
  • Upload location lets the user specify the export location of the CSV file(s).
    • It can be any of the supported cloud drives - SharePoint, OneDrive, Google Drive and Dropbox.
    • The upload location works like the aggregate of all of Willow's cloud drive actions (check them for more details)
      • It lets the user browse the location on the cloud drive
      • It lets them choose to create a subfolder at the location (if needed)
      • It lets them upload with the default user credentials or their own
    • The CSV file location is not in any way linked to the upload location of the files processed by the workflow.
  • Organisation language is used when generating a report
  • Export Data to CSV action's record in File History will have the link to the chosen location on the cloud drive where the file was exported.