How to Remove Extra Characters and Strings from Email Addresses
Sometimes, including plus (+) signs in emails, such as "jane.smith+newsletter@company.com", can be a useful tool for helping customers to organize their mailbox. Everything after the "+" sign serves as a label that helps them categorize incoming emails.
For businesses, this isn't always helpful and can even create formatting problems with integrations.
With Insycle's Transform Data module, you can easily identify emails with a "+" sign, and remove it and the included tag after it.
To do this, we use a regex function to tell Insycle what to look for in the address (+ and @) to help it identify what to remove. Then, we instruct Insycle to remove the + and everything after it, up to the @ sign.
Process Summary
- Filter your records to find those that include a "+" in the email address.
- Set up functions to remove everything between "+" and "@" from the values.
- Preview then apply the changes to the CRM records.
Step-by-Step Instructions
Navigate to Data Management > Transform Data, then select the database and record type in the top menu.
Filter your database down to the records that you would like to update.
Under Step 1, configure the Filter to look in the Email field for a plus symbol.
When you click Search, Insycle will list matching records in the Record Viewer at the bottom of the page.
Under Step 2, give Insycle instructions on what changes to make if a "+" is found in the email.
- Select the Email field.
- Select the Find & Replace: Regex any occurrence function.
- In the Existing Text field, enter the value(s) you are looking for. In this example, we're using the regular expression, "\+.*?\@". This isolates the "+" sign and everything after it until it reaches a @ sign.
- In the New Text field, enter the value to replace the identified string with. In this example, "@".
Examples
Before | After |
---|---|
skyleradams+alerts@acme.com | skyleradams@acme.com |
dave.wilson+newsletter@gmail.com | dave.wilson@gmail.com |
Preview Changes in CSV Report
Data transformation is a bit more difficult to visualize than basic value-A-to-value-B changes, so before applying changes to your CRM data, or when you're developing your new template, previewing the results is an important step.
Under Step 3, click the Review button and select Preview mode.
Click the Next button to go to the Notify screen, where you can select recipients and add context to the CSV report email.
On the When tab, click the Run Now tab, and select which records to apply the change to (you could do All, but if you have a large number of records, you may just want to do a chunk for your preview), then click the Run Now button.
Insycle will generate a preview CSV and send it to your email. Open the CSV file from your email in a spreadsheet application and review the (Before) and (After) columns.
In this example, the Email (After) values have been rewritten to replace "+XXXXXX@" with "@".
If your results don't look the way you expected, go back to your filters in Step 1 and functions in Step 2 and try making some adjustments, then preview again.
Apply Changes to Your CRM Records
When you're satisfied with the results in your preview, you can apply the changes to your CRM.
Under Step 3, click the Review button again, and this time select Update mode.
On the When tab, you should use Run Now the first time you apply these changes to the CRM. If you have a large number of records, you may want to do a smaller batch to review the results in your CRM.
After you've seen the results in the CRM and are satisfied with how the operation runs, you can save your configuration as a template and set up automation so this transform operation runs on a set schedule. If you have several templates you'd like to automatically run together, you can create a Recipe. Additionally, HubSpot users can integrate Insycle Recipes into HubSpot Workflows.
Return to the Template menu at the top of the page and click Copy to save your configurations as a new version of the template you started with. Then click the pencil to edit your new template name.
Under Step 3, click the Review button, and select Update mode.
On the Notify tab, select the send option appropriate for your automation: Always send, Send when errors, or Do not email.
Add any additional recipients who should receive the CSV (and make sure to hit Enter after each address). You can also provide additional context in the message subject or body.
On the When tab, select Automate, and configure the frequency you'd like the template to run. When finished, click Schedule.
You can view all your scheduled automations at any time on the Operations > Automations page.
Advanced How-Tos
With your filter and layout set, Insycle can export your segment of data.
In the Transform Data module, you can export your data one time, immediately or set up automated exports. This will export the current data without the Transform updates.
Click the Export button.
In the Export popup, select New File and click Next.
On the Email tab, enter additional email addresses (hit Enter after each), a Subject, and Description. The CSV export will be attached to this email whenever it is generated.
To export the data once:
On the When tab, click Run Now and select which records to apply the change to (in most cases this will be All), then click the Run Now button.
To set up automation for recurring exports:
On the When tab under Automate, set up the frequency your CSV should automatically be exported--hourly, daily, weekly, or monthly.
Then, data that matches your set filter will be automatically exported and emailed to you or your team on a set schedule, improving data collaboration and monitoring important customer data.
If you'd like to see additional fields in the export and Record Viewer, under Step 1 click the Layout tab, find the desired field in the right column, and drag it left to the Visible Fields column. Drag and drop fields in the Visible Fields column to reorder them.
These fields appear in the CSV export from Step 1, and the Record Viewer, though not in the Preview CSV.
Troubleshooting
The Transform Data preview CSV includes a fixed set of fields: record identifiers, a deeplink to the record in the CRM, and the Before and After values for the transformed fields. Other fields cannot be added.
To see all the fields that are in your Layout and Record Viewer, use the Export button under Step 1. This will export the current data without the Transform updates. For more detail, see the Advanced How-Tos above.
Additional Resources
Related Help Articles
- Module Overview: Transform Data
- Copy or Move Values Between Fields
- Conditional Bulk Update if Value=x Then Set It To=y
- Custom ETL
- Break an Address Into Multiple Fields
Related Blog Posts