Format Data
50+ data formatting operations for text, numbers, dates, JSON, and logic -- without writing code.
On this page
Overview
The Format Data action transforms, formats, and calculates data in your HubSpot workflows without writing code. Select an operation, map the input property, and the result is available for subsequent workflow steps.
With 50+ built-in operations across text, number, math, date, JSON, and logic categories, plus custom formula support, Format Data covers the vast majority of data transformation needs.
Setup
Add the action to your workflow
Search for "AuPerate: Format Data" in the HubSpot workflow editor.
Select an operation
Choose from the dropdown: uppercase, lowercase, number_format, date_format, add, and many more. Or select "custom" to write a formula.
Map the input and optional parameters
Map a HubSpot property to the input field. Some operations require a second input or parameter (e.g., the format pattern for dates, the number of decimal places).
Text Operations
| Operation | Description | Input | Result |
|---|---|---|---|
| uppercase | Convert to uppercase | hello world | HELLO WORLD |
| lowercase | Convert to lowercase | Hello World | hello world |
| capitalize | Capitalize first letter of each word | john smith | John Smith |
| trim | Remove leading/trailing whitespace | hello | hello |
| substring | Extract part of string (start, length) | hello (0, 3) | hel |
| replace | Replace text (find, replace_with) | hello (l, r) | herro |
| length | Return string length | hello | 5 |
Number Operations
| Operation | Description | Input | Result |
|---|---|---|---|
| number_format | Format with decimal places | 1234.5678 (2) | 1,234.57 |
| currency | Format as currency (symbol, decimals) | 1234.5 ($, 2) | $1,234.50 |
| percentage | Format as percentage | 0.456 (1) | 45.6% |
| round | Round to nearest integer | 3.7 | 4 |
| floor | Round down | 3.7 | 3 |
| ceil | Round up | 3.2 | 4 |
| abs | Absolute value | -42 | 42 |
Math Operations
Math operations use input1 and input2 as operands. Both must be numeric values (or HubSpot properties that resolve to numbers).
| Operation | Description | Example | Result |
|---|---|---|---|
| add | Add two numbers | 100 + 50 | 150 |
| subtract | Subtract input2 from input1 | 100 - 30 | 70 |
| multiply | Multiply two numbers | 25 * 4 | 100 |
| divide | Divide input1 by input2 | 100 / 3 | 33.33 |
Date Operations
| Operation | Description | Example | Result |
|---|---|---|---|
| date_format | Format a date with a pattern | 2026-04-10 (MM/DD/YYYY) | 04/10/2026 |
| date_add | Add time to a date (amount, unit) | 2026-04-10 (7, days) | 2026-04-17 |
| date_subtract | Subtract time from a date | 2026-04-10 (1, months) | 2026-03-10 |
| date_diff | Difference between two dates | 2026-01-01, 2026-04-10 (days) | 99 |
| now | Current date and time | (YYYY-MM-DD) | 2026-04-10 |
Date Format Tokens
| Token | Description | Example |
|---|---|---|
| YYYY | Four-digit year | 2026 |
| MM | Two-digit month | 04 |
| DD | Two-digit day | 10 |
| HH | Hours (24-hour) | 14 |
| mm | Minutes | 30 |
| ss | Seconds | 45 |
| A | AM/PM | PM |
JSON Operations
| Operation | Description |
|---|---|
| json_get | Extract a value from a JSON string using a path |
| json_stringify | Convert a value to a JSON string |
| json_parse | Parse a JSON string and extract a field |
Input: {"user": {"name": "John", "age": 30}}
Path: user.name
Result: JohnLogic Operations
| Operation | Description |
|---|---|
| default_value | Return input1 if it has a value, otherwise return input2 as the default |
| conditional | If input1 is truthy, return input2; otherwise return input3 |
Input1: "" (empty HubSpot property)
Input2: "Unknown"
Result: "Unknown"Input1: "closedwon" (lifecycle stage)
Input2: "Customer"
Input3: "Prospect"
Result: "Customer" (because input1 is truthy)Custom Formulas
Custom formulas let you combine multiple operations into a single expression. Set the operation tocustom and write your formula in the formula field.
Template Syntax
Reference HubSpot properties with {{property_name}} and mapped inputs with [[input1]], [[input2]], [[input3]].
Available Functions
Math Expressions
Standard math operators are supported: +, -, *, /
Nested Functions
Functions can be nested inside each other for complex transformations:
upper(concat({{firstname}}, " ", {{lastname}}))Step-by-step:
- 1.
{{firstname}}resolves tojohn - 2.
{{lastname}}resolves tosmith - 3.
concat()producesjohn smith - 4.
upper()producesJOHN SMITH
More Formula Examples
round({{deal_amount}} * 0.85, 2)
// If deal_amount = 1000, result = 850.00if({{firstname}}, concat("Hello, ", capitalize({{firstname}}), "!"), "Hello there!")
// If firstname = "john", result = "Hello, John!"
// If firstname = "", result = "Hello there!"upper(default({{company}}, "Unknown Company"))
// If company = "acme", result = "ACME"
// If company = "", result = "UNKNOWN COMPANY"concat(
capitalize({{firstname}}),
" - ",
if({{deal_amount}} > 10000, "Enterprise", "SMB"),
" ($",
round({{deal_amount}}, 0),
")"
)
// firstname = "john", deal_amount = 25000
// Result: "John - Enterprise ($25000)"Output Fields
| Field | Type | Description |
|---|---|---|
| optihub_success | Boolean | true if the operation completed without errors |
| result | String | The formatted/transformed output as a string |
| result_number | Number | The result as a number (if applicable, e.g., math or number operations) |
| optihub_error | String | Error message if the operation failed, empty if successful |
Next: Hash and Encrypt
Learn how to hash, encrypt, and encode data in workflows.