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 pathsumByString(data, fieldPath)= sum numeric values by field pathcountBySrting(data, fieldPath)= count items in an arrayshowCB(value)= return checkbox mark (✓or✘) from truthy/falsy valuesshowCBIcon(value, trueIcon, falseIcon)= return a custom icon for truthy/falsy valuesjoinByField(data, fieldPath, separator)= join field values into one stringjoinByFieldUniq(data, fieldPath, separator)= join unique field values into one stringlookupKeyValData(data, keyName, keyValue, outputField)= find one record and return a field value
groupByString
Groups records by a field path.
Sample 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.
Sample context
{
"Opportunity": {
"Products": [
{"LineTotal": 1200},
{"LineTotal": 800},
{"LineTotal": 50}
]
}
}
Expected result: 2050
countBySrting
Counts array items.
Sample context
{
"Opportunity": {
"Products": [
{"LineTotal": 1200},
{"LineTotal": 800},
{"LineTotal": 50}
]
}
}
Expected result: 3
showCB
Returns a checkbox symbol by truthy/falsy evaluation.
Expected result:
true→ ✓false→ ✘
showCBIcon
Returns custom icons for truthy/falsy values.
Expected result:
true→ YESfalse→ NO
joinByField
Joins field values with a separator.
Sample context
{
"Opportunity": {
"Products": [
{"Name": "Starter"},
{"Name": "Support"},
{"Name": "Training"}
]
}
}
Expected result: Starter, Support, Training
joinByFieldUniq
Joins only unique values from a field.
Sample 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.
{
"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
Best Practices
- Use explicit field paths (for example
Product2.Family) for predictable output. - For list joins, choose separators that match your document style.
- Use
joinByFieldUniqwhen repeated labels should appear once. - Use
showCB/showCBIconfor 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:
Result: 3 (for 3 products)
How do I sum numeric values across multiple records?
Use sumByString to total field values:
Result: 2,050 (sum of all line totals)
How do I group records by a field?
Use groupByString to organize by category:
Result: Groups products by Software, Services, etc.
How do I show checkmarks for boolean values?
Use showCB for simple true/false display:
Result: ✓ or ✘
How do I display custom labels for yes/no fields?
Use showCBIcon with custom values:
Result: "Closed" or "Open" / "✅" or "⏳"
How do I join product names with a separator?
Use joinByField to create a list:
Result: Starter, Support, Training
How do I join unique values to avoid duplicates?
Use joinByFieldUniq to list only one of each:
Result: Software, Services (Software appears only once even if multiple products)
How do I lookup a related value by key?
Use lookupKeyValData to find a record by code:
Result: Beta (finds record where code="B" and returns label value)