The “Format Data” action helps you clean up or change data in contact, deal, and account fields using ActiveCampaign automations. This can help you keep your data clean, consistent, and up-to-date.
Take note
- The operations available in the Format Data action are based on your plan
- When using deal fields, to ensure Format Data action changes apply to the correct deal, we recommend only using deal fields in automations with a deal trigger. The deal that triggered the automation is used by default. If no deal trigger is used, the most recently created deal for the contact is used instead.
How the “Format Data” action works
To access the “Format Data” from your automation, click on the (+) node where you want to add the action, then click “Workflow” > “Format Data.”
The “Format Data” action differs from other actions because it has four operations to choose from. Below are the three primary ways to use the Format Data action and four operations you can use in this action:
- Text changes: This allows you to take text strings and change them. For example, format a phone number or web address. The text change operations are:
- Date changes: This allows you to take a date field or datetime field and change it. The date change operation is:
- Perform math: This allows you to take numeric values stored in fields and perform math operations. For example, add two fields together or subtract one field by another. The operation for this is:
To set up an operation, you will be asked for an input and an output field. You can use any contact, deal, or account field for either field.
Input Field
- This is where we take the value from.
- If there's no value, the contact will skip this action.
Output Field
- This is where the new, formatted value is saved.
- You can choose to update the same field or send it to a different field of the same type.
Text change operations
Text change operations allow using standard text, custom text, or text area fields.
The value in the fields you select must be a numeric value, or the action will be skipped.
“Extract phone numbers or URLs”
Available on Plus, Professional, and Enterprise plans.
The “Extract phone numbers or URLs” action lets you extract a phone number or URL from an existing contact, account, or deal field and format it.
Extract phone number
When extracting phone numbers, the system will look for a phone number in the input field provided and format it to one of the three following options:
- E.164 (recommended if you are using SMS or WhatsApp, and is the standard used by all international carriers)
- National format
- International format
You can select a 'Default country code' to use when a phone number doesn't include one. If the input already contains a country code, it will be used. If it doesn’t have one or the code doesn’t match any known format, the selected 'Default country code' will be applied instead.
Extract URL
When extracting URLs, the system will look for a web address in the input field provided and format it to one of the following options:
- Domain
- Protocol (includes https://)
In addition, you can choose to include or trim additional URL path information in the output with one of the following options:
- Include paths
- Example: www.example.com/my/page
- Trim paths
- Example: www.example.com
“Capitalize a field”
Available on Plus, Professional, and Enterprise plans.
The “Capitalize a field” operation within Format Data lets you capitalize text within a contact, account, or deal field to a selected output.
You have four capitalization outputs to choose from:
- Title Case
- Sentence Case
- Proper Case
- Upper Case
- Lower Case
Title Case formatting is not recommended for non-English language text strings. The system cannot accurately detect which characters should be capitalized.
Date changes operation
Date change operations allow using date or datetime fields.
“Add or remove time from a date field”
Available on Professional and Enterprise plans.
The “Add or remove time from a date field” action lets you add or subtract a specified number of days from a given date or datetime contact, account, or deal field to a selected output.
When using datetime fields, only the date will be affected. The time will not change.
Configure the “Perform math” operation
Available on Professional and Enterprise plans.
The "Perform Math" operation within Format Data lets you perform calculations on numeric Contact, Deal, and Account custom fields. You can do math using values from Text, Text Area, Number, or Money fields.
The value in the fields you select must be a numeric value, or the action will be skipped.
With this action, there are two ways you can adjust the value of an existing field, using either Basic Math, such as add, subtract, multiply, or divide, or the Advanced Math function.
- Click Automations on the left menu.
- Edit the automation to which you want to add the "Perform Math" operation.
- Click the node (+) where you want to add the action.
- In the "Add an action" modal, click "Workflow" > Format Data > "Perform Math" to add it to your automation.
-
In the “Value 1” field, either click the lightning bolt icon to add an existing field or input a numerical value.
You can enter a number in one of the value fields, but at least one value field must use an existing field to save the action.
- In the next field, click the dropdown and choose a math function for the action. You can choose from Added to, Minus, Multiplied by, and Divided by.
-
In the “Value 2” field, either click the lightning bolt icon to add an existing field or input a numerical value.
You can enter a number in one of the value fields, but at least one value field must use an existing field to save the action.
- (Optional) Use “Advanced math.” Enter a mathematical formula using common keyboard characters for up to 25 fields. Learn about supported characters with “Advanced math.”
- In the “Output” field, click the dropdown and choose an existing field where the result of the “Perform math” operation will be updated.
All output values are rounded to the 4th decimal place if the output value is not a whole number.
Supported Characters when using advanced math
When using the advanced math function within the “Perform Math” operation, the following characters are supported:
Character | Operation |
+ | Add |
- | Subtract |
* | Multiply |
/ | Divide |
. | Decimal place |
() | Order of operations |
When attempting to use non-whole numbers (i.e. percentages or fractions) you must express them using decimals.