Remove extra text from your Zap data
- Tables
-
Product updates
Product updates: January 2023 Product updates: March 2023 Product updates: February 2023 Product updates: April 2023 Product updates: May 2023 Product updates: June 2023 Product updates: July 2023 Product updates: August 2023 Product updates: September 2023 Product updates: October 2023 Product updates: November 2023 Product updates: December 2023 Product updates: January 2024 Product updates: February 2024 Product updates: March 2024 Product updates: April 2024 Product updates: May 2024 Product updates: June 2024 Product updates: July 2024 Product updates: August 2024 Product updates: September 2024 Product updates: October 2024 Product updates: November 2024 Product updates: December 2024 Product updates: January 2025 Product updates: February 2025 Product updates: March 2025 Product updates: April 2025 Product updates: May 2025 Product updates: June 2025 Product updates: July 2025 Product updates: August 2025
- Zaps
- Your Zapier account
- Interfaces
- Canvas
- Chatbots
- Getting started
- Agents
- MCP
- Built-in tools
- Lead Router
- Apps
Table of Contents
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 outline, click the Action step or the plus sign + to add a new action. 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.