You are here: Designer > Features > Personalizing Content > Formatting Variable Data
 

Formatting variable data

When a Text Script, made with the Text Script Wizard (see Using the Text Script Wizard) adds variable data to a template, it can easily change the way the data are formatted as well. This is done in the Text Script Wizard through a special formatting modifier or a format mask for each field that the script adds to the template.

You could also format data in a script using the formatter ; see Designer Scripts API.

Date

Dates in variable data can be displayed as long, medium and short dates with different time displays. There are quite a few presets, but you can also enter a custom format mask.

  1. Open the Text Script Wizard: double-click to open an existing script in the Scripts pane or create a new Text Script using the Text Script Wizard; see Using the Text Script Wizard.
  2. Click a data field that contains text, or add such a data field to the script with the Add field button on the right.
  3. Under Format you can choose one of the following options:
    • Short Date displays the day, month and year in two digits each, for example 01.04.16.
    • Medium Date displays the day and month in two digits each and the year in four digits, for example 01.04.2016. (This is also the value of the Default Date.)
    • Long Date displays the day as a number, the month's full name and the year in four digits, for example 1. April 2016.
    • Short Time displays a time in hours and minutes in two digits each, for example 00:00.
    • Medium Time displays a time in hours, minutes and seconds in two digits each, for example 00:00:00. (This is also the value of the Default Time.)
    • Long Time displays a time in hours, minutes and seconds in two digits each, and adds a time zone, for example 00:00:00 EDT.
    • Short Date/Time displays the date as a short date and the time as a short time, for example 01.04.16 00:00.
    • Medium Date/Time displays the date as a medium date and the time as a medium time, for example 01.04.2016 00:00:00 (This is also the value of the Default Date/Time.)
    • Long Date/Time displays the date as a medium date and the time as a medium time, for example 1. April 2016 00:00:00 EDT.
    The locale influences the way dates, times, numbers and currencies are formatted; see Locale.
  4. Close the Script Wizard. For a new script, don’t forget to add the selector to the template.

Font style

Text originating from variable data can be displayed in uppercase, lowercase or proper case.

  1. Open the Text Script Wizard: double-click to open an existing script in the Scripts pane or create a new Text Script using the Text Script Wizard; see Using the Text Script Wizard.
  2. Click a data field that contains text, or add such a data field to the script with the Add field button on the right.
  3. Under Format choose the correct setting:
    • Uppercase transforms all characters to uppercase.
    • Lowercase displays transforms all characters to lowercase.
    • Propercase transforms the first character of each word to uppercase and all other characters to lowercase.
    • None leaves the text as is.
  4. Close the Script Wizard. For a new script, don’t forget to add the selector to the template.

Numbers and currencies

Numbers, and strings existing of digits, can be displayed as a number with a certain formatting or as an amount of money.

  1. Open the Script Wizard: in the Scripts pane, double-click the script, or create a new Text Script using the Text Script Wizard; see Using the Text Script Wizard.
  2. Click the data field that contains the numeric value that you want to display differently, or add the data field to the script with the Add field button on the right.
  3. Under Format choose one of the following settings:
    • Grouped displays a number with three decimal places and sets the thousands separator for the value based on the current locale; see Locale.
    • Currency displays a number as an amount of money, with a thousands separator and rounded to two decimal places, based on the current locale; see Locale.
    • Currency no symbol does the same as Currency, but omits the currency symbol.
  4. Close the Script Wizard. For a new script, don’t forget to add the selector to the template.