Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Json output step allows to generate json blocks based on input step values. Output json will be available as java script array or java script object depends on step settings.

...

Transformation with json output usage example

Options

General Tab

General tab allows to specify type of step operation, output json structure, step output file. This file will be used to dump all generated json.

...

This will be one object (one output row) with data block containing json array with 4 objects (as we had 4 input data rows). Please note - when using 0 'Nr. rows in a block' step will build output object until input data is available. When input is done - one big output object will be passed to output row. For big input data it can impact memory usage.

Output

...

File

Option

Description

Filename

full path to output file

Append

If not checked new file will be created every time step is running. If file with specified name already existed - it will be replaced by a new one. If checked - new json output will be appended at the end of existing file. Or if existing file is not exists - it will be created as in previous case.

Create Parent folder

Usually file name contains some path folder as a parent folder. If parent folder does not exists and this option is checked - parent folder will be created as a new folder. Otherwise - file not be found and step will fail.

Do not open create at start

If not checked - file (and in some cases parent folder) will be created/opened to write during transformation initialization. If checked - file and parent folder will be created only after step will get any first input data.

Extension

Output file extension. Default value is 'js'

Encoding

Output file encoding

Pass output to servlet

Enable this option to return the data via a web service instead writing into a file (see PDI data over web service)

Include date in filename?

If checked - output file name will contains File name value + current date. This may help to generate unique output files.

Include time in filename

If checked - output file name will contains file creation time. Same as for 'Include date in filename' option

Show filename(s) button

Can be useful to test full output file path

Add file to result filenames?

If checked - created output file path will be accessible form step result

...

Option

Description

Fieldname

Input step field name. Use 'Get Fields' button to discover available input fields

Element name

Json element name as a key. For example "A":"B" - A is a element name, B is actual input value mapped for this Element name.

Metadata Injection Support

All fields of this step support metadata injection. You can use this step with ETL Metadata Injection to pass metadata to your transformation at runtime.