Forum Discussion
Conditional field code
- Apr 30, 2026
You must not type the curly braces! You must generate them using Ctrl+F9 (in my French version). Also, there is a non-breaking space in the error messages (in my version).
You are using the STYLEREF field to check the content in the latest use of the Topic name style.
Here are resources on the STYLEREF field:
- CAE421Apr 30, 2026Copper Contributor
Thanks for the reply. The following field code works to insert the numbering for the text with the paragraph style called "Topic name".
eg. 1.1 Heading name
If the heading that's styled with "Topic name" has numbering applied then the numbers are inserted. If there is no numbering applied then it inserts zero (0).
I'm trying to use a conditional if statement to check to see if the numbering is 0 and if yes, then not to insert any numbering at all, including no zero. Here is what I was using:
I tried to remove the quotation marks as suggester by the other poster and the code looked like this:
The above gives me the error:
Error! Unknown switch argument.
The resources you suggest don't mentioned IF statements which is why I'm posting here.
Any further help appreciated.