> For the complete documentation index, see [llms.txt](https://docs.dbnetsoft.com/dbnetsoft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnetsoft.com/dbnetsoft/screenspro/sources/file.md).

# File

This source reads a JSON or XML file from disk and reads it again every time the file changes. The file is watched rather than polled, so a layout follows a file another program writes as soon as it is written.

## Settings

| Setting  |          |                                                                                     |
| -------- | -------- | ----------------------------------------------------------------------------------- |
| Filename | string   | Full path of the file that is watched. Quotation marks around the path are ignored. |
| Format   | Enum     | `Json` or `Xml`. Default `Xml`.                                                     |
| Interval | TimeSpan | Has no effect. The file is read when it changes, not in an interval.                |

Name and Enabled are described on the [Sources](/dbnetsoft/screenspro/sources.md) page.

## Properties

| Property    |        |                                            |
| ----------- | ------ | ------------------------------------------ |
| FileContent | string | The raw content of the file for debugging. |
| Value       | object | Result                                     |

## The parsed value

With `Json` the file is parsed the same way as the answer of a [HTTP REST (GET)](/dbnetsoft/screenspro/sources/http-rest-get.md) source: an object becomes an object whose properties are bound by name, an array becomes a list addressed with an index.

With `Xml` the parsing starts at the root element:

* Attributes become properties of the element they belong to.
* An element whose children all have the same name becomes a list, addressed with an index.
* An element whose children have different names becomes an object with one property per child.
* An element without children becomes its text.

A file that cannot be read, that is empty, or that does not parse sets `IsSuccess` to false and describes the problem in `ErrorText`.
