How can we help you?

Greater flexibility of exports with conditions

With conditions, you can export contents in export documents, depending on whether certain requirements have been fulfilled: for example you could export prices only if they are under €10,000 and you could instead export “on request” for higher prices. In the case of frame dimensions, the suffix “framed” could be exported only if frames with corresponding dimensions are actually available for the work.

This can all be performed seamlessly with export conditions!

Conditions can only be used in document and in text exports.

Conditions can be used if the export of information should be connected to conditions: if a specified condition applies, then the information requested is output in the document. If the condition has not been fulfilled, for example because information is missing, then you can define whether this information should be left out entirely, or whether an alternative text should appear.

An example: with this condition (marked in red), the edition is output only if something has been entered in the Edition field. If the field is empty, then instead the word unique will be automatically output.

${w.ArtistFirstLast}
${w.Title}, ${w.Year}
${w.Technique}
${w.ExtendedSize}
[#if w.Edition != ""]
Ed. ${w.Edition}
[#else]
unique
[/#if]
Work with information on edition:
first name last name
work title, year
technique
measurements
Ed. 2/5 (entered edition: 2/5)
Work without information on edition:
first name last name
work title, year
technique
measurements 
unique (no edition entered)

Condition Basics

In order to use conditions in your text and document export templates, place a text block – to which a condition should apply – between two markings: a start marker [#if condition], in which the desired condition is defined, and an end marker [/#if], that marks the end of the text block. The text enclosed by the markings is then only output if the condition from the start marker applies. The markings themselves will be removed completely in the export. The simplest variants of conditions look like this:

[#if condition]
Example text
[/#if]

Optionally, additional alternative conditions can be used that are then tested if the first condition does not apply. You can also specify a text that is then always exported if none of the conditions apply:

[#if condition 1]
Example text, if condition 1 applies
[#if condition 2]
Example text, if condition 1 does not apply, but condition 2 does apply
[#else]
Example text, if neither of the two conditions apply
[/#if]

As soon as a condition applies, the test is stopped. If, for example, condition 1 and condition 2 both apply, then only the text for condition 1 will be output as the test will be stopped after condition 1 has been fulfilled.

Please note: conditions may also be nested. The text block dependent on the condition may itself also contain conditions.

Formulating conditions

A condition is a statement (for example the frame dimensions are not empty) that is checked and is then either true (there are frame dimensions) or false (there are no frame dimensions). Here, the value of a dataset (a work or a contact) shall be checked in terms of its properties: for example “is the Edition field of a work empty”, “is the Work status of a work sold” or “do the Categories of a contact contain ‘VIP’”?

The property of the dataset to be checked (work or contact) shall be written in the conditions exactly as in the corresponding placeholders that are already known about from our templates. In conditions, the Dollar sign and the curly brackets are omitted; the Edition is, for example, just written as w.Edition.

The most important statements are explained in the following overview with examples.

Is equal =
[#if w.soldStatus = "sold" ]
The Status of the work is equal to (=) “sold”.
[#if w.soldState = 3 ]
The Status code of the work is equal to 3 (code for sold, in all languages).
Is not equal !=
[#if w.soldStatus != "available" ]
The Status of the work is not equal to (!=) “available”.
[#if w.soldState != 0 ]
The Status code of the work is not equal to 0 (code for available, in all languages).
Is empty = ""
[#if w.Edition = "" ]
The property Edition of the work is equal to (=) empty text (“”).
Is not empty != ""
[#if w.Edition != "" ]
The Edition of the work is not equal to (!=) empty text (“”).
Is greater than gt
[#if w.PriceNetValue gt 10000 ]
The Net price of the work is greater than (gt, greater than) 10000.
Caution: only real numbers can be compared sensibly, i.e. the corresponding Value placeholder must be used, e.g. w.PriceNetValue or w.PriceGrossValue!
Is lower than lt
[#if w.PriceNetValue lt 10000 ]
The Net price of the work is lower than (lt, lower than) 10000.
Caution: only numbers may be compared!
Contains ?contains("Searchtext")
[#if c.categories?contains("VIP") ]
The Categories of the contact contains (?contains) the search text string (“VIP”).
[#if c.categories?lower_case?contains("vip") ]
The lower case (?lower_case) Categories of the contact contains (?contains) the search text string (“vip”) (does not take upper case and lower case into account).
Does not contain ! ?contains("Searchtext")
[#if ! c.categories?lower_case?contains("vip") ]
The lower case (?lower_case) Categories of the contact does not (!) contain (?contains) the search text string (“vip”) (does not take upper case and lower case into account).