Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Examples and how to

Example of setting metadata from XML file when using external file sources in M-Files

Last updated on 23 April 2025

Admin
Connections to External File Sources (Integrated)

Overview

It is possible to use XML files to define metadata for objects when using external file sources. The following example shows one practical example of how this can be done. You can define the correct metadata by opening file sources' properties and selecting the Metadata page. 

"Read from an XML file" will let you specify the XPath expression that will be used to read the value from the XML file.

The XPath expression document/customer will find the customer node from the XML file and add "ESTT Corporation" to the metadata card. If the customer ESTT Corporation cannot be found from the vault the property will be left empty. In this case the "name" node in the XML file won't be used since the correct XPath expression to it hasn't been defined in the first picture.

Notes:

  • The name of the XML file must match the name of the file to be imported.
  • It is only possible to add one value to each property even though the property would be multi-select. However, we have an existing product improvement to enable multiple values to be added.

Additional information

How to open and read XML-files: Article.

External File Sources

Defining Metadata for an External File Source

Still need help?