Skip to content
Last updated

Exporting Data With Parameters

You can include parameters when specifying data for export in workflows.

You can see examples of various configurations for integrations in TD's open GitHub repository. A detailed workflow example using result output using FTP can be found at GitHub repository.

The parameters that you use in Workflow are determined by the result export type.

Generic code example within a workflow definition.

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-into-target:
  td>: queries/sample.sql
  result_connection: your_connections_name
  result_settings:
    parameter1: value1
    parameter2: value2
    ....

FTP Result Output using result_settings Example

In Treasure Workflow, specifying result output through FTP looks like this:

timezone: UTC

_export:
  td:
    database: sample_datasets

+td-result-via-ftp:
  td>: queries/sample.sql
  result_connection: ftp-out
  result_settings:
    path_prefix: /path/to/file
    sequence_format: ""
    file_ext: csv
    compression: None
    header_line: None
    delimiter: ","
    null_string: ""
    newline: CRLF

Parameters that you can apply to your result output through FTP are:

ParameterDescription
path_prefixPrefix of output paths (string, required)
file_extdefault: csv (string, (csv or tsv))
sequence_formatFormat for sequence part of output files (string, default: ".%03d.%02d")
compressiondefault None (string(None|gz |bzip2))
header_linedefault true (boolean(true|false))
null_stringdefault "" (string(""|"\N"|NULL|null))
delimiterdefault "," (string(","|"\t"|"tab"|"|"))
newlinedefault CRLF (string(CRLF|CR|LF))