> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filesystem: Read files

> Reads the contents of a file from a filesystem and adds it to the data.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Reads a file from a filesystem and adds its contents to the data so later steps can work with it. Use this to pull in a file that lives alongside your main data, for example reading a product feed, a configuration file, or a previously exported document. The file's content is decoded from its format (such as JSON, XML, or CSV) into structured data and placed in the data under a key that matches the file's path. If the file does not exist, the data passes through unchanged.

This documentation describes: [Schema](/schemas/transformer/read-files)

## Fields

<FormField property="filesystem" label="Filesystem connection" required diType="filesystem">
  The filesystem connection that holds the file you want to read.
</FormField>

<FormField property="filePath" label="File location" required>
  The path to the file, including the file name and extension, for example `imports/products.json`. You can use [placeholders](/references/placeholders) here to build the path from the data. This same path is also used as the key under which the file's content is added to the data.
</FormField>

<FormField property="parser" label="Parser" required diType="deserializer">
  The format the file is written in, so its content can be decoded into usable data. Pick the format that matches your file, such as JSON, XML, or CSV.
</FormField>

## Sample data

This step reads a file from a real filesystem connection and adds its decoded contents to the data, so there is no fixed before/after to show. The configuration below reads `imports/products.json` with the JSON parser; the decoded content is added to the data under the key `imports/products.json`.

| Field                 | Value                           |
| --------------------- | ------------------------------- |
| Filesystem connection | The connection holding the file |
| File location         | `imports/products.json`         |
| Parser                | JSON                            |

```json Configuration theme={null}
{
  "prototype": "read-files",
  "parameters": {
    "filesystem": "import-files",
    "filePath": "imports/products.json",
    "parser": {
      "prototype": "json"
    }
  }
}
```
