completed workflow how to compare two field values

Need to be able to compare two properties to see if they have they have the same value in a Hubspot workflow? While this isn’t native functionality, there are a couple quick ways to do this. Probably the most robust is to use custom code in a workflow— but this requires a paid Operations Hub subscription. What to do if you don’t have Operations Hub? Read on!

Even though there isn’t a “does this field equal this field” as an option in an If/Then step— We can leverage the “Property A is modified after property B” functionality to accomplish this.

Note: We’re going to demo this for a contact, but this works exactly the same for deals/companies as well!

Let’s say we’ve got two properties (Property 1 and Property 2) and we want to compare if they have the same value in them.

 

How to compare them?

1) Create two new properties— a check-box property, and a temporary holding property (the property type should be the same as whatever you’re comparing- we’ll use a text field here, but this works for dropdowns/numbers/multi-selects as well).

Create two new fields, a checkbox, and a temporary holding field.

2) Create a workflow. Use whatever trigger criteria you want to run this. If you want this to run continually whenever either of these two have a value; you can use “Property 1 is known” or “Property 2 is known” and turn on re-enrollment.

3) Add flow step: “Copy Property Value” and copy the value from “Property 1” to “Property – Temp to Check”.

Flow step 1

4) Add flow step: “Set Property Value”, and set the value of “Property – Checkbox” to “Yes”.

5) Add flow step: “Copy Property Value” and copy the value from “Property 2” to “Property – Temp to Check”.

6) Add flow step, If/Then. For branch 1, select the “Property – Checkbox” and select “Was updated after property – Property – Temp to Check”. This branch will be followed when Property 1 and Property 2 are the same value.

7) Put in whatever logic you want under the two branches— Remember, the Branch 1 was created for whatever we wanted to occur when Property 1 and 2 were the same; and None Met branch will be for when the values are different.

 

8) End the workflow by clearing the values in “Property – Temp to Check” and “Property – Checkbox” (Tip: can simply put this on the end of either branch, and use a “Go to other action” so you only have to have this once).

completed workflow how to compare two field values

That’s it! Depending on what you set for the trigger actions, this will run whenever you need. In the example here, we set this to run continually whenever these two values were populated, and to write to the property “Property 1 & 2 the same?” either a “Yes :)” or “No :(” value— and after activation, you can now see this on all our contacts!

 


For more information, or to schedule a discovery call to see how Areveo can drive value for your brand, reach out below!

Related posts

Leave a Comment