Skip to main content
TMaier
Helper ⭐️
February 8, 2022
New Idea

"Only update if changed" option in Load To rule actions

  • February 8, 2022
  • 1 reply
  • 39 views

A few times recently, I’ve written rules that are meant to update fields on an object that may or may not have changed. In the interest of avoiding unnecessary writes, I’ve used a case statement to compare the existing and “new” value for those fields and only flag records where the two are different. This is usually a 2-3 task job, on top of my original logic.

 

It would be amazing if “Load To” type Rule Actions came with a checkbox on fields for “Only update if different” or something to that extent, to help further automate that kind of behavior.

1 reply

TMaier
TMaierAuthor
Helper ⭐️
February 8, 2022

Example use-case: your clients can elect to purchase “premium support” as an add-on service. They can do this at any time during their contract period, and it may appear as a line item on any quote. You are tasked with keeping a “Support Level” field up to date on Company.

 

You need to query the quote-level data and filter to whatever the SKU for your premium support product is, and then aggregate to get the LAST quote closed with that SKU on it. Once you’ve got that handled, you can either: 1.) update every Company with the field value, regardless of what it had been before, which results in (presumably) a lot of overwriting one value with the same value again, or 2.) Add additional tasks to fetch the current “Support Level” from Company, merge it to the results of your original logic, and then apply a case statement to mark instances where the old and new values differ. You can then filter your Action based on the value returned in that case statement.

 

Seems like a lot of extra work to avoid writing the same value to a field repeatedly even though it hasn’t changed.