DynoMerge
Help Center › Conditional formatting

Conditional formatting

Make the document react to the data: red overdue dates, warning banners that only appear when relevant, values styled by condition.

The quickest way: the Conditional block button

In the template editor, select the text or table you want to make conditional, then press ± Conditional block in the toolbar. Pick the field it depends on and press Wrap selection. Tick invert for the opposite case — show the block only when the field is empty.

That writes the tags for you. Everything below is the same thing typed by hand, which is worth knowing so you can read and edit what the button produced.

Show a section only when a condition is true

{#field | test} ... {/} renders its contents only when the test passes; {^field | test} ... {/} renders only when it FAILS.

Editing one later: the tags are ordinary text in your document. To change which field a block depends on, edit the name inside {# … }. To remove the condition and keep the content, delete the opening and closing tags. To flip it, change {# to {^ or back.

The big red banner that appears only for overdue quotes:

{#Opportunity.CloseDate | ispast}⚠ PAST DUE ⚠{/}

Style the whole thing (30pt, bold, red) in your template — when the close date isn't past, the entire paragraph vanishes from the output.

The same pattern hides/show anything: a discount paragraph only when {#Opportunity.Discount__c}...{/} has a value, a renewal notice only for past dates, alternate wording for the false case with {^...}.

Style a value by condition

Combine a section with dynamic style filters:

Close date: {#Opportunity.CloseDate | ispast}{Opportunity.CloseDate | dateformat("%B %d, %Y") | color("red") | bold}{/}
{^Opportunity.CloseDate | ispast}{Opportunity.CloseDate | dateformat("%B %d, %Y")}{/}

Read it as: if past → date in red bold; otherwise → date normal. The same trick powers a grand total that's red when overdue, blue otherwise:

{#Opportunity.CloseDate | ispast}{Opportunity.Amount | currency | color("red") | bold}{/}
{^Opportunity.CloseDate | ispast}{Opportunity.Amount | currency | color("blue") | bold}{/}

Dynamic style filters

Chainable, applied at merge time (they override the template's static formatting for that value):

Filter Effect
\| bold bold
\| italic italic
\| underline underline
\| color("red") text color — names (red, blue, green…) or hex (color("C00000"))
\| highlight("yellow") highlight

The tests

Test True when
\| ispast the date is before today
(bare field) the field has any non-empty value

{#Opportunity.NextStep}Next step: {Opportunity.NextStep}{/} prints the line only when Next Step is filled in — the cleanest way to avoid orphaned labels next to blank values.

Working sample

Import the starter library and open Quote (past-due formatting) — it uses every technique on this page. Generate it against a record with a past close date, then a future one, and compare.

Gotchas