Skip to main content

Convert to XLSX

Current configuration of the Convert to XLSX task in the Workflow Designer

The Convert to XLSX task performs the inverse operation of the Convert to CSV task: it takes a data file in CSV format and converts it into an Excel (.xlsx) spreadsheet. It is particularly useful for generating reports or files that need to be easily viewed, formatted, and manipulated by end-users using software such as Microsoft Excel.

Configuration

Configuring the task requires specifying the source CSV file and its separator, as well as an optional destination for the Excel file.

  • File to Import: Enter the full path to the CSV file to be converted in this field. It can be a static value or a dynamic parameter.
  • Input CSV Separator: This field is crucial for the correct interpretation of the source file. Enter the character that the input CSV file uses to separate its values here.
  • The default value is the comma (,).
  • If the source file uses a different separator (e.g., a semicolon), it is essential to set it correctly in this field. An incorrect setting will cause the conversion to fail or result in an Excel file where all data is incorrectly grouped into a single column.
  • File Path (Checkbox): Selecting this option allows you to specify a custom destination for the output file; otherwise, a default destination will be used. If selected, the following fields will appear:
  • Output Path: Enter the folder path where you want to save the converted Excel file here.
  • Create Path if Not Exists: If enabled, the destination folder is created automatically if it does not exist. If disabled, the task will fail if the folder is not present.

Default Destination

The default behaviour depends on how the source file is provided:

  • Case 1: Input via "File" Type Parameter When the source file is passed via a dynamic parameter from a previous task or workflow parameters, the converted XLSX file is saved to a system-managed directory.
  • Case 2: Input via Manually Written Path When you write the full path of an existing file directly into the "File to Import" field (e.g., /data/input/report.csv), the converted XLSX file is saved by default in the same directory as the source file (i.e., in /data/input/).

Output Parameters

Once the conversion is complete, the task exposes the following parameters:

  • file: Returns the full path of the newly created XLSX file (e.g., /output/path/converted_data.xlsx). This parameter is ideal for passing the file to subsequent tasks, such as sending an email with an attachment.
  • filename: Returns only the name of the generated XLSX file (e.g., converted_data.xlsx).
  • result: Indicates the overall status of the conversion operation (e.g., "Success" or an error message).
  • resultJson: Represents the execution result of the task in JSON format, including general information, configurations, and execution details.