This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Change display of Boolean Values

Former Member
Former Member
Hi Folks,

A customer has indicated that they need the fields we have assigned as Boolean to display a Yes/No value rather than a Y/N.

I have not been able to find a way to change this, am I just missing something obvious?

The only other work around I can think of is to change the fields from Boolean to choose from list = yes / no, but would like to avoid this as there are several hundred property definitions that needs to be adjusted.

Many thanks,
Pod
  • Have you changed the True and False Text values on the metadata card configuration? By default, Boolean properties are Yes/No drop-downs, so the fact that they are currently Y/N for you would suggest that someone has changed them from the default.
  • Former Member
    Former Member

    Have you changed the True and False Text values on the metadata card configuration? By default, Boolean properties are Yes/No drop-downs, so the fact that they are currently Y/N for you would suggest that someone has changed them from the default.


    Sorry; I wasn't exactly clear. It is displaying as Yes and No on the metadata card and we are happy with that, however it is when the property is referenced in a project document and used to populate a cell in a table that it comes up as Y or N within the word document.

    But in answer to your question, no, we haven't made any changes from the metadata card configuration module.

    It seems quite minor but our client is insistent that they would like to keep it as "Yes" or "No" in their documentation as that is how they have always done it.

    Many thanks,
    Pod
  • So this is really a matter of handling the inserted field in Word rather than configuration in M-Files.
    You can get some guidance on this in wordmvp.com/.../MMergeIfFields.htm and similar posts on the Internet.
    I have successfully tested a field code with this content
    { IF {DOCPROPERTY "MFiles_PG813AF1C4F5874EC892D9D92FF1FDE6DD" \* MERGEFORMAT} = "Y" "Yes" "No"} 

    meaning that if the Boolean value from M-Files is TRUE ("Y") then write "Yes" else write "No".
    As stated in the link above you cannot type in the curly brackets {} yourself, you must use Ctrl-F9 to insert them in Word. It is a bit tricky but doable!
  • Former Member
    Former Member

    So this is really a matter of handling the inserted field in Word rather than configuration in M-Files.
    You can get some guidance on this in wordmvp.com/.../MMergeIfFields.htm and similar posts on the Internet.
    I have successfully tested a field code with this content
    { IF {DOCPROPERTY "MFiles_PG813AF1C4F5874EC892D9D92FF1FDE6DD" \* MERGEFORMAT} = "Y" "Yes" "No"} 

    meaning that if the Boolean value from M-Files is TRUE ("Y") then write "Yes" else write "No".
    As stated in the link above you cannot type in the curly brackets {} yourself, you must use Ctrl-F9 to insert them in Word. It is a bit tricky but doable!


    Hey bright-ideas,

    I've had a go but I can't seem to get it to work. Can I be a bit thick and ask whereabouts within this string I place the M-Files property? Or does the property I'm trying to display as Yes not go inside the string?

    I've tried it a whole bunch of ways but none of them seem to work.

    Many thanks,
    Pod
  • Hi Pod,
    As I said, it is not in M-Files but in your Word or Excel document you need to handle this.
    So you need to edit the inserted field in the template or document itself, not in M-Files.
    When you insert a plain M-Files property into a Word document the field code in Word will look something like this:
    {DOCPROPERTY "MFiles_PG813AF1C4F5874EC892D9D92FF1FDE6DD" \* MERGEFORMAT}

    and it will show a "Y" for yes and a "N" for no if it is a boolean type property.
    You need to manipulate the way Word displays the result, and you do this by adding some logic to the field code in Word.
    So the code in my example says "if the M-Files property yields a "y" then show "Yes" else show "No".
    You can change the last bit to show anything you like - even to add different background colors etc.
    Please follow the link to get guidance on how to edit the field code in Word.
  • Former Member
    Former Member
    Thanks bright-ideas, I got there in the end!

    Many thanks,
    Pod