Skip to main content

Advanced Functions Helpers

This page documents advanced custom helpers available in your helper library.

Use these helpers when you need grouping, aggregation, lookup, boolean display, or joining values from collections.

Function name meaning (quick reference)

  • groupByString(data, fieldPath) = group array items by field path
  • sumByString(data, fieldPath) = sum numeric values by field path
  • countBySrting(data, fieldPath) = count items in an array
  • showCB(value) = return checkbox mark ( or ) from truthy/falsy values
  • showCBIcon(value, trueIcon, falseIcon) = return a custom icon for truthy/falsy values
  • joinByField(data, fieldPath, separator) = join field values into one string
  • joinByFieldUniq(data, fieldPath, separator) = join unique field values into one string
  • lookupKeyValData(data, keyName, keyValue, outputField) = find one record and return a field value

groupByString

Groups records by a field path.

Example: Group products by family
{{groupByString Opportunity.Products "Product2.Family"}}

Sample context

Input context
{
"Opportunity": {
"Products": [
{"Product2": {"Family": "Software"}},
{"Product2": {"Family": "Services"}},
{"Product2": {"Family": "Software"}}
]
}
}

Expected result: object grouped by Software and Services keys.

sumByString

Sums values from a field path in an array.

Example: Sum line totals
{{sumByString Opportunity.Products "LineTotal"}}

Sample context

Input context
{
"Opportunity": {
"Products": [
{"LineTotal": 1200},
{"LineTotal": 800},
{"LineTotal": 50}
]
}
}

Expected result: 2050

countBySrting

Counts array items.

Example: Count products
{{countBySrting Opportunity.Products "LineTotal"}}

Sample context

Input context
{
"Opportunity": {
"Products": [
{"LineTotal": 1200},
{"LineTotal": 800},
{"LineTotal": 50}
]
}
}

Expected result: 3

showCB

Returns a checkbox symbol by truthy/falsy evaluation.

Example: Show checkbox from boolean
{{showCB Account.Active__c}}
Example: Actual values
{{showCB true}}
{{showCB false}}

Expected result:

  • true
  • false

showCBIcon

Returns custom icons for truthy/falsy values.

Example: Custom icons
{{showCBIcon Opportunity.IsClosed "✅" "❌"}}
Example: Actual values
{{showCBIcon true "YES" "NO"}}
{{showCBIcon false "YES" "NO"}}

Expected result:

  • trueYES
  • falseNO

joinByField

Joins field values with a separator.

Example: Join product names
{{joinByField Opportunity.Products "Name" ", "}}

Sample context

Input context
{
"Opportunity": {
"Products": [
{"Name": "Starter"},
{"Name": "Support"},
{"Name": "Training"}
]
}
}

Expected result: Starter, Support, Training

joinByFieldUniq

Joins only unique values from a field.

Example: Join unique product families
{{joinByFieldUniq Opportunity.Products "Product2.Family" ", "}}

Sample context

Input context
{
"Opportunity": {
"Products": [
{"Product2": {"Family": "Software"}},
{"Product2": {"Family": "Services"}},
{"Product2": {"Family": "Software"}}
]
}
}

Expected result: Software, Services

lookupKeyValData

Finds one object by key/value and returns another field from that object.

Example: Lookup by key and return value
{{lookupKeyValData LookupData "code" "B" "label"}}
Input context
{
"LookupData": [
{"code": "A", "label": "Alpha"},
{"code": "B", "label": "Beta"}
]
}

Expected result: Beta

If no match is found, output is null.

Practical end-to-end example

Opportunity summary block
Products count: {{countBySrting Opportunity.Products "Name"}}
Products total: {{sumByString Opportunity.Products "LineTotal"}}
Families: {{joinByFieldUniq Opportunity.Products "Product2.Family" ", "}}
Primary status: {{showCBIcon Opportunity.IsClosed "Closed" "Open"}}

Best Practices

  • Use explicit field paths (for example Product2.Family) for predictable output.
  • For list joins, choose separators that match your document style.
  • Use joinByFieldUniq when repeated labels should appear once.
  • Use showCB/showCBIcon for clear human-readable boolean output.

Common Use Cases

How do I count items in a collection array?

Use countBySrting to get the total number of items:

{{countBySrting Opportunity.Products "Name"}}

Result: 3 (for 3 products)

How do I sum numeric values across multiple records?

Use sumByString to total field values:

Total Line Value: {{sumByString Opportunity.Products "LineTotal"}}

Result: 2,050 (sum of all line totals)

How do I group records by a field?

Use groupByString to organize by category:

{{groupByString Opportunity.Products "Product2.Family"}}

Result: Groups products by Software, Services, etc.

How do I show checkmarks for boolean values?

Use showCB for simple true/false display:

Is Active: {{showCB Account.Active__c}}
Is Closed: {{showCB Opportunity.IsClosed}}

Result: ✓ or ✘

How do I display custom labels for yes/no fields?

Use showCBIcon with custom values:

Status: {{showCBIcon Opportunity.IsClosed "Closed" "Open"}}
Approval: {{showCBIcon Account.Approved__c "✅" "⏳"}}

Result: "Closed" or "Open" / "✅" or "⏳"

How do I join product names with a separator?

Use joinByField to create a list:

Products: {{joinByField Opportunity.Products "Name" ", "}}

Result: Starter, Support, Training

How do I join unique values to avoid duplicates?

Use joinByFieldUniq to list only one of each:

Product Families: {{joinByFieldUniq Opportunity.Products "Product2.Family" ", "}}

Result: Software, Services (Software appears only once even if multiple products)

Use lookupKeyValData to find a record by code:

{{lookupKeyValData LookupData "code" "B" "label"}}

Result: Beta (finds record where code="B" and returns label value)

More resources