Skip to main content

File Content to Field

Description

Use the step to read the complete content of one or more text-based files and output each file's content as a single string field in a row.

When you process a single file, the step generates one output row. When you process multiple files, the step generates one output row for each file. Each row contains the full content of the corresponding file in a single output field.

Important

File size must be 1 MB or smaller.

Supported File Types

The step only supports the following text-based file types:

  • .json - JSON documents
  • .xml - XML documents
  • .log - Log files
  • .html - HTML documents
  • .txt - Plain text files

If the step encounters unsupported file types (for example, .pdf, .xlsx, .docx, or .csv) at runtime, the step fails.

Scenario Example

If you process two input files, the step produces exactly one output row for each file. Each row contains:

  1. The complete file content (located in the configured Content field).
  2. Any configured additional metadata fields. Output
OutputShort_filenamesize
{"name":"Alice","age":30}alice.json26
<note><to>Bob</to></note>note.xml25

Configurations

Field NameDescription
Step nameName of the step. The name must be unique in a single workflow.

File Tab

  • Use the tab to define the static files or folders you want the step to read.
Field NameDescription
File or DirectorySpecify the file path or click Browse... to select the required file path.

You can also specify a folder path and use a regular expression to filter the files within that folder.

- File example: C:\data\report.json
- Folder example: C:\data\logs

The field accepts static or environment variable.
(Button) AddClick to add the specified file or folder to the Selected files grid. The step only reads files added to this list.
Regular ExpressionIf you specify a folder, enter a regular expression to filter and include specific files. Leave this blank if you specify a direct file path.

For example:
- ..json - Matches all .json files in the folder
- error_.
.log - Matches log files starting with "error_"
- report_2024.* - Matches any file starting with "report_2024"

The field accepts static or environment variable.
Exclude Regular ExpressionSpecify the regular expression to exclude specific files from the folder scan.

For example:
- .*_backup.json - excludes files ending in _backup.json

The field accepts static or environment variable.
EncodingSelect the character encoding that matches your source files to prevent garbled output characters.
Default value: UTF-8
Selected filesDisplays the queued files or folders alongside their configuration details.

- Required: Select Y to fail the step if the file is missing at runtime. Select N to skip missing files without failing.
- Include Subfolders: Select Y to read files within nested subfolders. Select N to read only the top-level folder.

The field accepts variable or static values
Add filename to resultSelect the checkbox to add the read filenames to the workflow result. This creates a unique list in a memory for use in downstream steps or parent workflows.

Accept filename from previous step

  • Use the section to determine file paths dynamically at runtime by reading them from an incoming stream.
Field NameDescription
Accept filename from previous stepSelect the checkbox to read filenames from an upstream step instead of using the static list. Use this when file paths are determined dynamically at runtime.
Pass through fields from previous stepSelect the checkbox to keep all fields from the incoming row in the output row, alongside the new file content. If cleared, the step ignores upstream data fields.
Step to read fromSelect the upstream step that provides the filenames.
Field in the input to use as filenameSpecify the incoming field that contains the file path data.
Show filename(s)…Click to view the generated list of filenames selected for reading.
Show file contentClick to preview the raw content of a selected file.
Preview rowsClick to preview the final output rows generated by the step.

Output fields tab

  • Use the tab to add optional metadata columns to your output rows.
  • Leave a field blank to exclude that specific metadata column from the output.
Field NameDescription
Content FieldSpecify the name of the output field that stores the actual file content.
Default value: output
The field is mandatory and the field accepts static or environment variable.
Extension fieldSpecify the output field name to store the file extension
For example: json
The field accepts static or environment variable.
Path fieldSpecify the output field name to store the complete path of the input file
For example: C:\data\logs
The field accepts static and environment variable.
Size fieldSpecify the output field name to store the size of the input file in bytes
For example, 26
The field accepts static or environment variable.
Is hidden fieldSpecify the output field name to indicate if the file is hidden on the operating system. Returns Y for hidden files else return N.
The field accepts static or environment variable.
Last modification fieldSpecify the output field name to store the date and time the file was last modified.
The field accepts static or environment variable.
Uri fieldSpecify the output field name to store the full URI path of the file.
Root uri fieldSpecify the output field name to store the root portion of the file URI.
The field accepts static or environment variable.