User guide

98
Label Studio User’s Guide
Examples of value expressions and conditional filters
To help illustrate the process of creating new expressions and filters, this section
walks you through a few scenarios. Each one will have a brief description of what
you will accomplish and the steps necessary to do it.
Scenario #1: Printing
the current date and
time
Say you want to place the current time and date on every address label in our
mailing. For this scenario, you will need to do the following things:
Drop an Expression field onto the layout
Create a value expression telling Label Toolbox to print the current time and
date in the field.
Once you have dropped your Expression field onto your layout, you will need to
create your value expression. To do this:
1. Select the Expression field on your layout and choose Format > Properties.
2. Click the Filter Browser button next to the Value Expression box. In the
Filter Browser window, click New.
3. In the Filter Name box, type an appropriate title, such as Date and Time.
4. In the Functions box, select time() and click Add. This appears in the Filter
Syntax box.
5. In the Operators box, select the ampersand (&) symbol and click Add. Your
expression should look like this: time()&.
6. In the Functions box, select dtoc(DATE) and click Add. Your expression
should look like this: time()&dtoc(DATE).
7. Place your cursor between the parentheses in dtoc(DATE) function and
delete the word DATE. Now select date() from the Functions box and click
Add. Your expression is now complete and should look like this:
time()&dtoc(date()).
If the expression differs from this, it will not work. You can go into the Filter
Syntax box and use your keyboard to correct any mistakes.
8. Click OK until you reach your design window. Choose View > Label
Preview to see the date and time stamp on your labels.
Scenario #2: Printing
“Current Resident”
Say you have a mailing list where some records are missing information in the
first name field, last name field, or both. For the records missing any of this
information, you want to print the phrase “Current Resident” on the label.
Once you have dropped your Expression field (under Miscellany) onto your
layout, you need to set up your value expression to tell Label Toolbox to print
“Current Resident” in the field. To do this:
1. Select the Expression field and choose Format > Properties.
2. Click the Filter Browser button next to the Value Expression box. In the
Filter Browser window, click New. In the Filter Builder window, type a name
for your new value expression, such as Current Resident.
3. In the Filter Syntax box, type Current Resident.