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
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 page.
Properties
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) 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.