Using Custom Properties in if stmt (conditional content)

Discuss the word processor

Using Custom Properties in if stmt (conditional content)

Postby EigenFunctions » Thu Dec 12, 2019 1:10 am

I want to use a custom property (File->Properties->Custom Properties) as part of an if statement (conditional content). In the documentation (Writer Guide, DocInformation Fields, Section 14, page 455) it states this is possible. What is the name of the variable to use? The custom property I used is "Church", but when I put it in the if statement box (e.g., Church EQ "Montana") it doesn't result in the "true" branch (which it should).

As an aside, I tried creating a variable and that works in the IF statement. But the definition of variables, unlike properties, are part of the content of the file not a property of the file.

Can anyone help?
Thanks,
EigenFunctions
    AOO:
      Ver 4.1.7
      AOO417m1(Build:9800) - Rev. 46059c9192
      2018-10-23 07:03 - Linux x86_644
    Laptop:
      Acer A515-51-50RR
      7.7 GiB Mem; Intel Core i5-7200U CPU @ 2.50GHz × 4; 1 TB HDD
      Ubuntu 18.04.2 LTS
User avatar
EigenFunctions
 
Posts: 5
Joined: Tue Jul 13, 2010 3:08 pm
Location: East Coast USA

Re: Using Custom Properties in if stmt (conditional content)

Postby EigenFunctions » Thu Dec 19, 2019 10:32 pm

I tried some combinations of words connected with dots and colons (e.g., custom:church, etc.), but nothing seems to work.

Can anyone help?
Thanks,
EigenFunctions
    AOO:
      Ver 4.1.7
      AOO417m1(Build:9800) - Rev. 46059c9192
      2018-10-23 07:03 - Linux x86_644
    Laptop:
      Acer A515-51-50RR
      7.7 GiB Mem; Intel Core i5-7200U CPU @ 2.50GHz × 4; 1 TB HDD
      Ubuntu 18.04.2 LTS
User avatar
EigenFunctions
 
Posts: 5
Joined: Tue Jul 13, 2010 3:08 pm
Location: East Coast USA

Re: Using Custom Properties in if stmt (conditional content)

Postby Lupp » Fri Dec 20, 2019 1:10 am

This won't work.

You can insert user defined document properties as TextField strings via Insert>Fields>Other...>DocInformation>Custom. They aren't variables, however, and you cannot access them via Insert>Fields>Other...>Variables nor use them in conditions under Insert>Fields>Other...>Functions>Conditional text.

If you want to spend more time on this, you may write user code for the option Insert>Fields>Other...>Functions>Execute macro.
On Windows 10: LibreOffice 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2654
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany


Return to Writer

Who is online

Users browsing this forum: No registered users and 12 guests