The camelcase helper converts a string to camelCase format, removing non-alphanumeric characters (spaces, dashes, slashes, underscores) and capitalizing the first letter of each word after the first. Use it to standardize field names, generate API keys, or format labels consistently.
Syntax
{{camelcase value}}
value -- The string to convert. Required. Non-string inputs (numbers, booleans) are converted to strings before processing. Arrays of primitive values are converted to a comma-separated string before processing. Objects and object arrays produce unusable output.
Examples
Convert a space-separated string
{{camelcase record.product.type}}
Input:
{ "record": { "product": { "type": "hand crafted item" } } }
Output: handCraftedItem
Convert a dash-separated string
{{camelcase record.category}}
Input:
{ "record": { "category": "new-arrival-products" } }
Output: newArrivalProducts
Preserve numbers and remove special characters
{{camelcase "version-2_1-final"}}
Output: version21Final
Numbers are preserved in place. Non-alphanumeric characters are treated as word separators and removed.
Usage notes
- Non-alphanumeric characters (spaces, dashes, slashes, underscores) are treated as word separators and removed.
- Numbers are preserved in the output:
"order_123_id"→order123Id. - All-caps strings are converted to camelCase:
"HELLO&WORLD"→helloWorld. - Leading and trailing whitespace is trimmed before conversion.
- Do not pass objects or object arrays -- the output will be unusable.