Ask Your Question
1

How can I access a custom document property in a condition statement?

asked 2012-03-07 00:24:02 +0200

basil.bourque gravatar image basil.bourque flag of United States
11 1 3

updated 2012-03-07 01:03:08 +0200

MagicFab gravatar image MagicFab flag of Canada
690 5 12 23
http://wiki.documentfound...

The Writer Guide documentation says I can use my own custom document property instead of a variable in a condition statement.

DocInformation fields

“Using document properties to hold metadata and information that changes” on page 363 described how to set up a custom document property. You can use that document property as the variable in your condition statement, or you can create another document property field specifically for conditions.

From: Chapter 14 "Working with Fields" of Writer Guide, page 377 in PDF

How do I use a document property rather than a variable?

When I type the name of the property, in a "Conditional text" function in the Insert Fields Other dialog, I always get the first phrase, never the second. So it seems my conditional test is being ignored or incorrectly always returning True.

After seeing "DocInformation:" displayed when I choose View > Field Names, I tried prepending that to my property name in my Conditional text function, like this: DocInformation:MyDocumentPropertyNameHere But that did not help. I always see the first phrase of the conditional text.

Is there some trick to accessing a Document Property in a function?

I get success when using a variable, so I am not totally confused/stupid.

For example, what would be different in these steps, taken from LibreOffice Help topic "Defining Conditions":


To display conditional text based on a user-defined Variable Choose Insert - Fields - Other, and then click the Variables tab.

  1. Choose Insert - Fields - Other, and then click the Variables tab.
  2. In the Type list, click "Set Variable".
  3. In the Name box, type "Profit".
  4. In the Value box, type "5000".
  5. Click Insert.
  6. Click the Functions tab, and click "Conditional text" in the Type list.
  7. In the Condition box, type "Profit < 5000".
  8. In the Then box, type "Target is not met".
  9. In the Or box, type "Target is met".
  10. Click Insert.

To edit the contents of the "Profit" variable, double-click the variable field.


Using LibreOffice LibreOffice 3.5.0rc3 on Mac OS X 10.7.3

Cross-posted to the mailing list.

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
0

answered 2012-12-18 20:37:26 +0200

Smudger gravatar image Smudger
1 1

updated 2012-12-18 20:40:26 +0200

The only document property variables you can use are listed in the Help page returned from the search term 'Variables - document properties', in the table 'Variables for document properties'. No others can be used and a statement to that effect can be found on the Help page returned from the search term 'formulating conditions'. Use the document property variable of your choice from step 6 onward in the example you gave. The Guide is in error and will be updated at the next release.

link delete flag offensive edit

Comments

Sounds reasonable to me -- can anyone verify this, please?

qubit ( 2013-01-24 19:01:52 +0200 )edit
0

answered 2012-10-27 22:08:32 +0200

yota gravatar image yota
1 1

updated 2012-10-27 22:09:03 +0200

(sorry, not enough karma to comment, but enough interest to bump)

I would be really really interested in this one. Can find only questions, and no answers :

http://www.oooforum.org/forum/viewtopic.phtml?t=181381

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-03-07 00:24:02 +0200

Seen: 407 times

Last updated: Dec 18 '12