Overview
You may run into situations where properties embedded into Office documents either show no value or show an error like "Error! Unknown document property name". This article explains how to decode the property references in Office documents so that you can find out which M-Files properties are being referenced from the Office documents.
Solution
Let's look at an example. Here is the header part of a document from the M-Files Sample vault:
Date, Agreement ID and Customer are filled in from the document properties. The property values are shown by default.
Press Alt+F9 to display the field codes instead of the values.
In documents created in very old M-Files versions, the field codes look like this:
The highlighted parts are the IDs of the M-Files property definitions referred to from the document. So to find the corresponding property definitions, simply finds the highlighted IDs in M-Files Admin under Metadata Structure (Flat View) > Property Definitions.
In documents created in modern M-Files versions, the field codes look like this:
The highlighted parts are the GUIDs of the M-Files property definitions referred to from the document. However, the dash characters have been removed from the GUIDs. Decoding these takes a little more effort.
The full GUID format with dashes is:
8 characters - 4 characters - 4 characters - 4 characters - 12 characters
So the correct GUID for Customer in the image above would be:
E6AB14DA-8B38-464B-8439-4619BE47F345
Here are two methods for identifying the target property based on the GUID extracted above:
Method 1
- In M-Files Admin, got to Metadata Structure (Flat View) > Property Definitions.
- Go to the View menu at the top of the window and select Add/Remove Columns.
- Add the Unique ID column to the Displayed columns list and click OK:
This will add the Unique ID (GUID) column to the far right of the Property Definition listing. - Use the scroll bar at the bottom of the window to scroll to the right to see the newly added Unique ID column.
- Drag the column to the left, so that you can conveniently see both the Name and Unique ID columns at the same time.
- Sort the list by the Unique ID column and look for the GUID shown in your document.
Method 2
- In M-Files Admin, go to Content Replication and Archiving.
- Create a one-time export which contains all property definitions and nothing else:
- Select a destination for the replication package on the Package Location tab and run the export.
- In Windows File Explorer, go into the folder where you exported the replication package.
- In the package, go to the Metadata folder.
- Open the Structure.xml file in a text editor. In this example, we use Notepad++.
- Use Ctrl+F to find the GUID shown in your document:
In the example above, we can see that the GUID matches with property definition ID 1079, whose name is "Customers".
