Phase 4 ยท Reference Material

Transformer Library

Phase 4 extends the Transformer Library with practical Transformer action patterns and low-level troubleshooting notes.

ConditionsDeletePerformanceRearrangeSelectionTroubleshooting
Redacted samples: Sensitive names, URLs, IDs, customer values, infrastructure details, and project-specific values have been replaced with generic placeholders.

CurrentText One-line Cleanup

Use a Rearrange script to flatten multiline text.

CurrentText = CurrentText.replace(/[\r\n]+/g, " ");

When to use

Use when object output needs one line.

Notes

This is code, so it has a copy button.

HTML Cleanup in CurrentText

Cleans simple HTML paragraph text in a Rearrange object.

CurrentText = CurrentText
    .replace(/<\/p>/gi, "\n")
    .replace(/<p[^>]*>/gi, "")
    .replace(/&nbsp;/gi, " ");

When to use

Use when mail body content comes from simple HTML.

Notes

Do not use for complex HTML layout.

Delete Duplicate Detail Nodes

Use a Delete action with an XPath that matches duplicate rows.

Detail[FIELD_ID = preceding-sibling::Detail/FIELD_ID]

When to use

Use when the XML contains repeated records and only the first should remain.

Notes

Confirm the current parent node in Transformer before applying.

Delete Empty Nodes

Matches elements whose normalized text is blank.

*[normalize-space(.) = ""]

When to use

Use for cleanup passes when blank XML elements cause layout issues.

Notes

Be careful: parent nodes containing only child elements may also have blank string values.

Select Non-first Details

Matches all Detail records after the first.

Detail[position() > 1]

When to use

Use for removing repeated header-style nodes under the same parent.

Notes

Do not use if each detail is meaningful.

Condition on Existing Value

Condition expression requiring a real value.

normalize-space(FIELD_NAME) != ""

When to use

Use on Transformer actions that should only run when a field exists.

Notes

Whitespace-only fields become empty.

Condition on Text Match

Condition expression for a specific text value.

normalize-space(Status) = "Open"

When to use

Use to trigger actions based on a status or flag.

Notes

XPath text comparisons are case-sensitive.

Set Dynamic HTML Button

Builds a reusable HTML button from a URL JobInfo.

var url = job.getJobInfo("<UrlJobInfo>");
if (url && !/^https?:\/\//i.test(url)) url = "https://" + url;
CurrentText = '<a href="' + url + '"><span style="text-decoration:none;font-weight:bold;">Open Link</span></a>';

When to use

Use when a report/email object must become a clickable link.

Notes

Email clients vary in how they handle styling.

Filter Early

Use narrow XPath selection before heavy actions.

When to use

Use Delete, Sort, or Rearrange actions on the smallest possible node set.

Notes

This is a tip, so no copy button.

Preview vs Final Output

Preview may look correct while submitted/output data differs.

When to use

Check runtime JobInfos, ranges, selected nodes, and execution context.

Notes

This is explanatory guidance, so no copy button.

Related Topics

Phase 5 adds related-topic guidance to reduce duplicate entries and make reusable patterns easier to find.

RedactedReviewedCanonical