Available on plans:
Free
Professional
Team
Enterprise
Formatter’s Text action has two transforms that you can use to remove extra whitespace in your data, like spaces and new lines, or to trim the total length of your data. This is helpful when the whitespace causes issues in another field or another field has a character limit.
- Trim whitespace: removes any whitespace at the beginning or end of your string.
- Truncate: shortens your string to a maximum length that you designate.
- You’re trying to map a phone number field from your form trigger to a phone number field in your email marketing platform but when users enter an extra space after the phone number, it causes an error. You can use the Trim Whitespace transform to remove it.
- You want to re-post your Facebook post in Instagram but Instagram has a shorter character limit. You can use the Truncate transform to shorten your post.
1. Add a Formatter step
- In the Zap editor, click the Action step. A dialog box will open.
- In the search box, search for and select Formatter. The right sidebar will open to the Setup tab.
- Click the Action event field to open the dropdown menu and select Text.
- Click Continue to continue to the Configure tab.
2. Set up your transform
- Click the Transform field to open the dropdown menu, then select the transform that you want the Zap to perform on your string:
- Trim whitespace.
- Truncate.
- In the Input field, manually enter the string you want to transform or map a field from a previous step.
- If you’re using the Truncate transform:
- In the Max Length field, enter the maximum number of characters that your copy should contain before the transform truncates it.
- (Optional) In the Skip Characters field, enter the number of characters that the transform should ignore at the start of the string before counting for truncating.
- (Optional) In the Append Ellipsis? Field, select Yes to add an ellipsis
...
to the end of your truncated string to indicate it was shortened. Otherwise, select No.
- Click Continue to continue to the Test tab.
3. Test your action
- Click Test step.
- The Data out tab will display the transform output so you can confirm your string was formatted correctly.
- If the new data is not what you expect, you can adjust the transform settings and retest the step again.
Once you’ve set up your Formatter action, you can use the results in further actions in your Zap.