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:
- The complete file content (located in the configured Content field).
- Any configured additional metadata fields. Output
| Output | Short_filename | size |
|---|---|---|
{"name":"Alice","age":30} | alice.json | 26 |
<note><to>Bob</to></note> | note.xml | 25 |
Configurations
| Field Name | Description |
|---|---|
| Step name | Name 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 Name | Description |
|---|---|
| File or Directory | Specify 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) Add | Click to add the specified file or folder to the Selected files grid. The step only reads files added to this list. |
| Regular Expression | If 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 Expression | Specify 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. |
| Encoding | Select the character encoding that matches your source files to prevent garbled output characters. Default value: UTF-8 |
| Selected files | Displays 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 result | Select 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 Name | Description |
|---|---|
| Accept filename from previous step | Select 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 step | Select 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 from | Select the upstream step that provides the filenames. |
| Field in the input to use as filename | Specify 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 content | Click to preview the raw content of a selected file. |
| Preview rows | Click 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 Name | Description |
|---|---|
| Content Field | Specify 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 field | Specify the output field name to store the file extension For example: json The field accepts static or environment variable. |
| Path field | Specify 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 field | Specify 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 field | Specify 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 field | Specify the output field name to store the date and time the file was last modified. The field accepts static or environment variable. |
| Uri field | Specify the output field name to store the full URI path of the file. |
| Root uri field | Specify the output field name to store the root portion of the file URI. The field accepts static or environment variable. |