Modifiers
This guide provides a comprehensive overview of how to utilize data modifiers within the merge system. It covers various aspects, including formatting dates, performing arithmetic operations, calculating percentages, and implementing boolean modifiers.
Data Modifiers
Data modifiers change how a field's value is displayed or calculated. Add a modifier after the field name, separated by a dash, with arguments in parentheses. Example: job-closingDate-format(d MMMM yyyy).
Common modifier types:
| Modifier | Purpose | Example Usage | Result Example |
|---|---|---|---|
format | Format value (date, number) | job-closingDate-format(d MMMM yyyy) | 5 June 2025 |
add | Add to value (number/date) | job-purchasePriceTotal-add(5000) | Adds $5,000 to total price |
percent | Calculates the amount based on the percentage you put in the brackets | job-commissionTotal-percent(50) | Shows 50% of commission total (calculated) |
Percentage Modifier
You can use the percent modifier to display a calculated amount based on a percentage of a value, such as a commission. The modifier computes the percentage of the base field value and displays the resulting amount.
Example:
job-commissionTotal-percent(50)— if the commission total is $10,000, this shows$5,000.
Format Modifiers
Use the format modifier to control how dates appear. Common patterns:
| Format String | Example Output | Description |
|---|---|---|
yyyy | 2025 | Year only |
yy | 25 | Last two digits of year only |
MMMM | June | Month only (text) |
MM | 06 | Month only (number) |
M | 6 | Month only no leading zero (number) |
d | 5 | Day only |
dd | 05 | Day only (2 digits) |
d MMMM yyyy | 5 June 2025 | Day Month Year (month as text) |
MMMM yyyy | June 2025 | Month Year |
M/d/yyyy | 6/5/2025 | US short date |
yyyy-MM-dd | 2025-06-05 | ISO date format |
dd MMM yyyy | 05 Jun 2025 | Day (2 digits) Short Month Year |
MMM yyyy | Jun 2025 | Short Month Year |
d-MMM-yy | 5-Jun-25 | Day-ShortMonth-2digitYear |
In Use:
- Email example:
{{job-closingDate-format(d MMMM yyyy)}} - PDF example:
job-closingDate-format(d MMMM yyyy)
Real case: If the closing date is 5 June 2025, job-closingDate-format(d MMMM yyyy) → 5 June 2025.
Add Modifier
Use add to increase or decrease numbers or to add/subtract days from dates.
Add to Numbers
job-purchasePriceTotal-add(5000)— adds $5,000 to the purchase price.
Add to Dates (Add/Subtract Days)
job-closingDate-add(7)— adds 7 days to the closing date.job-closingDate-add(-3)— subtracts 3 days from the closing date.
Example: If the closing date is 5 June 2025:
job-closingDate-add(7)→ June 12, 2025job-closingDate-add(-3)→ June 2, 2025
Boolean Modifiers
Yes Or No
- Purpose: Outputs
"Yes"or"No"based on a boolean value. - Example:
purchaser-[]-isResident-yesOrNo()→Yeswhen true,Nowhen false.
X or No X
- Purpose: Outputs
"X"or an empty, commonly used for checkbox-like outputs. - Example:
purchaser-[]-isResident-xOrNoX()→Xwhen true, otherwise empty.
Summary of Modifiers
| Modifier | Usage Example | Description |
|---|---|---|
| format | job-closingDate-format(MMMM yyyy) | Formats the closing date as "June 2025" |
| add | job-purchasePriceTotal-add(5000) | Add 5,000 to total purchase price |
| add (date) | job-closingDate-add(7) | Add 7 days to closing date |
| percent | job-commissionTotal-percent(50) | Show 50% of commission total (calculated) |
| yesOrNo | purchaser-[]-isResident-yesOrNo() | "Yes" or "No" depending on boolean value |
| xOrNoX | purchaser-[]-isResident-xOrNoX() | Outputs "X" or empty space depending on boolean value |