One must admit that M-Files Microsoft Office 365 integration is just awesome. It allows you to interact with your beloved Knowledge Workers content services Platform through Microsoft Office 365 products. Judge by yourself M-Files ribbon in Microsoft Office Word:
At least, If you are quite familiar with these functions, you may have already worked with “Insert Property” option in order to automate filing a Word document (set as standard or template in M-Files) with related M-Files metadata properties.
Principle
Basically, fill automatically text fields or cells in one template with the selected properties when a user creates a new document.
Very simple example illustration: create a Word file template listing document, add a title using M-Files metadata “Name or title” corresponding property
- Click on “Insert Property” button
- M-Files “Insert M-Files Property” dialog opens
- Double-click on “Name or title” property to add corresponding “Current Value” to Word document right where you placed your cursor
Easy and very helpful.
Until there, no such a big deal, you may think. In a sense, I concur.
Multi-select value list property
From time to time, you may have to deal with one particular M-Files metadata property data type i.e “Choose from list (multi-select)“, such as in below “Job title” example.
Insert this kind of property inside your Word document template, just like any others.
Now, suppose linking your Word document template object to a Workflow (main M-Files Knowledge Workers Business admin core activity, isn’t it ?). Consider you need to populate several fields with multi-select list values. Furthermore those values are empty during the very first state.
Contextualizing
* One simple Word document (Job title listing) flagged as “Is template” via M-Files property
* One M-Files metadata property (job title) set as multi-select data list among potentially others
1st difficulty that arises you may think about is the number of element management in the list. Since end user is free to add 1 to N elements available from the predefined list, it will be hard to anticipate it and set it accordingly unless your Workflow and Business case specifications lead you to control it through the different states.
In other words, either you control in advance the whole element list values you’d like to add in your target Microsoft Office 365 document or you will have to compose with the expected needs to insert these fields accordingly (probably by developing or scripting a bit) to achieve your goal without producing a document with missing or blank field values. I will leave this to reader expertise.
Back to Word template document structure
Let’s assume we have only 2 job titles values in our list.
Remember, in our case, “job title” list isn’t filled in yet and left blank.
Fire, check out, open my Word file template and insert both fields:
Hum … looks like something is not fully accessible:
See, only insert “Job title” and “Job title #1” list value seems to be available!
Anyway, let’s add them both, save our template document and check in it back to M-Files control:
To test and look at the content, I created a new document based on this template and selected 2 values from “Job title” list:
So, I guess you get the point. We have “Job title” M-Files property which is a kind of CSV with semicolon containing all list values set on M-Files metadata card’s document. Then “Job title #1” corresponding to the first value set at first position on “Job title” list property.
OK, but what’s about interacting with other list values, then ?
Solution / Workaround
First of all, this behavior should not confuse you . This is the way it is and is not really a bug. In order to retrieve the second “Consultant” value, let’s edit the field in Word to better understand its construction.
Check out Word template file, place your cursor into the first M-Files property field inserted corresponding to “Job title #1” and right click to pop-up “Toggle Fields Codes” option:
Here we are with this wonderful string “MFiles_PG12B4EA3AD6924B1BA8C780532C5E43BAn1“. If you are quite familiar with M-Files, you shall identify 12B4EA3AD6924B1BA8C780532C5E43BA as the unique ID registered for “Job title” property:
And finally guess that n1 at the end corresponds to value list position set. I’m pretty sure, now, you know how to handle it.
Check out Word template document, duplicate this field and increment n1 to n2, save and check in it:
Voilà !
Hoping it shall help you and save a bit of your time while trying to achieve Office 365 – Word template writing – interacting with M-Files property list.
Feel free to contact us for any support on our Enterprise Content Management solutions.