Conditional Bulk Update if Value=x Then Set It To=y

conditional update

How to Update a Field Based on the Value in Another Field

You need to make bulk updates to a field based on values that have been entered in another field. For example, if a record's State/Region value is "Quebec," then set the Country field value to "Canada."

Insycle makes identifying records with a specific field value easy and updating them based on your defined conditions. For straightforward "If value=x, set it to=y" tasks, use the Bulk Operations module. For more complex tasks where the initial values vary, the Transform Data module would be more appropriate.

Simple Conditional Updates with the Bulk Operations Module

In this section, we'll walk through a simple example of updating a contact's Country/Region field based on the US State.

Process Summary

  1. Filter your records down to those that you would like to update.
  2. Define how to change the filtered records.
  3. Preview your template, then update the data in your CRM.

 

Step-by-Step Instructions

Step 1: Filter Your Data

Navigate to Data Management > Bulk Operations.

Select the database and record type. Then explore the templates for an existing solution that may be close to what you need.

Under Step 1, set up a Filter to narrow the records down to only those you would like to update.

In this example, the filter is looking for records with a State/Region value of "New York."

mceclip0.png

When you click Search, Insycle will list matching records in the Record Viewer at the bottom of the page. These are the records that the changes you specify will be made to. 

Add columns to the view from the Layout tab under Step 1.

mceclip0.png

If you make changes to the filter, click the Search button again to refresh the results in the Record Viewer.

Step 2: Configure Rules That Will Update Your Field Data

Now you'll tell Insycle how to update data based on the condition you just set. 

Under Step 2, make sure you are working in the Update tab. When the Update action is applied, previously existing data will be removed from the field.

This change will be made to all records that match your Step 1 Filter– in this example, contacts with a State/Region value of "New York."

Select the Field Name that should be updated, and enter the New Value.

bulk-ops-step-2-update-country-US.png

Step 3: Preview and Apply Changes in Your CRM

Preview Changes in a CSV Report

Now with the filters and update actions in place, you can preview the changes. It's important to verify that your fields are being updated as expected before those changes are pushed to your live database.

Under Step 3, click the Review button, then in the Bulk Update popup, select Preview and click Next.

mceclip3.png

On the Notify tab, 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, 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.

Open the CSV file from your email in a spreadsheet application and review the columns. For each field you’ve set up to change, a column will appear for both (Before) and (After). This will let you know what you started with and what change will be made to your CRM. 

mceclip6.png

Apply Changes to Your CRM

If everything in your CSV preview looks correct, return to Insycle and move forward with applying the changes to the live CRM data.

Under Step 3, click the Review button, this time select Update mode.

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.

mceclip7.png

Save a Template and Setup Automation to Maintain Formatting

After you've seen the results in the CRM and you are satisfied with how the operation runs, you can save your configuration as a template, and set up automation so this formatting operation runs on a set schedule.

mceclip8.png

You can create templates for as many states or regions as needed, then create a Recipe to run them all together. 

Using templates and automation, you'll save time and ensure that your fields are consistently updated on an ongoing basis.

 

Complex Conditional Updates with the Transform Data Module

This section looks at a more complex example of syncing record owners across CRMs.

Let's say your team needs to sync Pipedrive people owners with HubSpot contact owners. Though you have the applications integrated, the fields don't natively sync, and the owner isn't associated properly in both systems. Additionally, these fields are storing the owner ID, not the actual name of the owner. 

The Transform Data module makes it easy to handle this using three functions—Map:Values, Map: Default, and Copy: Values.

Process Summary

  1. Filter records down to only those that have the correct format.
  2. Configure rules to look for X values, and if found, replace with Y values.
  3. Preview, then apply the changes to the CRM records.

 

Step-by-Step Instructions

Step 1: Find Records that Need Update

Navigate to Data Management > Transform Data, then select the database and record type in the top menu.

Under Step 1, filter your database down to the records that you would like to update.

In this example, we're looking for records that have not been updated in the last 7 days, that do have a value in the "Pipedrive Owner ID" custom field.

transform-data-hubspot-contacts-map-owners-step-1.png

When you click Search, Insycle will list matching records in the Record Viewer at the bottom of the page. 

transform-data-hubspot-contacts-map-owners-record-viewer.png

If you change the filter, click the Search button again to refresh the results in the Record Viewer. Add fields to the Record Viewer on the Layout tab of Step 1.

Step 2: Configure Rules to Write X Values Based on Y Values

Under Step 2, tell Insycle what values to look for, and what to replace them with if found.

Here is an example of mapping owner ID numbers so the Pipedrive Owner ID sets the HubSpot owner ID. The "Pipedrive Owner ID" field data is not modified; it's used as input for the mapping. The mapping output is applied to the "Contact Owner" field.

mceclip0.png

  1. Select the Field containing the value you want to look at.
  2. Select the Map: Values function. With this, all the content in the field must match the Existing Text value. If it matches, the New Text value will be used.
  3. In the Existing Text field, enter the value you want to look for. 
  4. If the Existing Text is found, the New Text value will be used for the next steps. In this example, if the Pipedrive Owner ID field has a value of "17282680," the New Text value, "199451430" will be used.
  5. Click the plus at the end of the row to add another function for this field.
  6. If there are different values you want to look for and map, add another Map: Values function. In this example, we're looking for either "19196515" or "1876250," and if either of those is found, the New Text value, "199451430" will be applied. We're mapping two Pipedrive owners to one HubSpot owner.
  7. When a value in the selected field doesn't match the Existing Text from either of the preceding functions, or it's blank, you can use the Map: Default value (unmapped) to apply a default value. 
  8. Select the Copy: Value function and the Target Field the new value should be written into. By copying the value to a different, target field, the data in the initial field remains intact.

You may need to do some experimentation. Use the Preview mode and CSV report to see if you get the desired result.

Step 3: Preview Changes and Update CRM Records

Preview Changes in the CSV Report

With the filters and functions set up, you can preview the changes in a CSV file. It's important to verify that your changes are working as expected before they are pushed to your live database.

Under Step 3, click the Review button, then select Preview in the popup.

transform-data-step-3-preview-mode-your-crm.png

On the Notify tab, you can select recipients for the emailed report and add additional context to the message. (Make sure to hit Enter after each email address.)

On the When tab, click Run Now 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.

Open the CSV file from your email in a spreadsheet application and review the (Before) and (After) columns. 

transform-data-hubspot-contacts-map-owners-csv.png

To help review the results in this example, we've pasted the original Pipiedrive Owner ID values in. This makes it easy to verify that the ID numbers are changing as expected. We get these by using the Export button under Step 1.

transform-data-hubspot-contacts-map-owners-csv-w-pasted-column.png

If the results don't look how you expected, return to your filters in Step 1 and functions in Step 2 and try making some adjustments, then preview again.

Apply Changes to the CRM

If everything in your CSV preview looks correct, return to Insycle and apply the changes to the live CRM data.

Under Step 3, click the Review button, 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.

transform-data-step-3-update-mode-run-now.png

Tips for Bulk Updating Values

If you aren't sure what values you have across your database, you should do a little exploratory work. Use the Cleanse Data module to get a summary of all the fields and the data they contain in your database. This makes it easy to review the values that are in use and decide how to set up your conditions.

Learn more about using the Cleanse Data module.

Advanced How-Tos

Create a Backup Export of Your Data Before Overwriting

When you're overwriting field data, you may want to refer to the old values or restore them later. You can export a CSV file that could act as a backup by clicking the Export button under Step 1.

transform-data-step-1-export-button.png

The CSV only includes fields that are visible in the Record Viewer. Use the Layout tab under Step 1 to add more fields and preserve all the data that might be needed.

Layout-drag-n-drop-w-border.gif

Frequently Asked Questions

Can I bulk update any field in my database?

As long as a field is writable, you can update it using Insycle. Use the Cleanse Data module to see a full list of writable fields.

Is the old data from the field deleted when I run the bulk update?

Yes, the pre-existing data in the record will be overwritten by the bulk update. If you need this data for reference or restoration, it will be available in the CSV in the Activity Tracker

Can I restore overwritten data from a bulk update?

Yes. All pre-existing data will be available in the Activity Tracker CSV for restoration purposes if required. Or, you can create a backup export of your data before overwriting, as explained in the Advanced How-Tos above.

Additional Resources

Related Help Articles

Related Blog Posts