Solved

Create CTA when a field has changed from value X to value Y


Userlevel 2
Badge
This question was originally asked by @irit_eizips 4 yrs ago (see here). I've seen no real update, nor do I see the "workaround" for which it is tagged.

The use case now is I'd like to trigger a CTA when our SFDC "Customer Type" field is changed from "Prospect" to "Customer."

Is this possible? (It seems like this is something that would have been updated in the past 4 years, but I can't find a solution either here in the community or in the documentation).

icon

Best answer by pele 9 October 2019, 19:03

View original

11 replies

Userlevel 6
Badge +2
Hey Scott– this should be possible by turning on history tracking for your field "Customer Type"

Once that's done, in GS Rules Engine, you can query the History Object for the object that the field is on (Account, maybe?) and just add the filters:

Field Name = Customer Type

Old Value = Prospect

New Value = Customer

Change Date = Subtract N Days from Rule Date:: 1

This will give you a list of customers where the change from prospect to customer happened the previous day.

Then you can add additional details as need through additional datasets and merges.

Userlevel 2
Badge
@pele Thank you for the reply. I appreciate it. I'll put this through it's paces to see how it works and let you know.

Userlevel 6
Badge +2
Good luck! Do circle back if you run into any hurdles. I took a peek at the old thread you referenced, and I think the blocker 4 yrs ago was not having bionic rules– back then, you could only create rules with 1 dataset from 1 object.

Userlevel 2
Badge
Hi Scott,

I wanted to add a note that @pele's proposed solution is spot on and should solve your ask. Please update the thread if you are able to get the CTA to fire properly using field history tracking!

Userlevel 2
Badge
Hey @pele, can I ask a couple questions:

  1. [quote]turning on history tracking for your field "Customer Type" [/quote]I wanted to confirm this is in SFDC...yes?
  2. It follows then that the History Object being queried is also in SFDC?
  3. Where would I get the "Old Value" "New Value" from? What I see in the History Object is the screenshot I've attached (from our dev site). How are you getting those 2 values?
Appreciate any help here with some of these basics.

Userlevel 7
Badge +2
1. Yes in SFDC.

https://help.salesforce.com/articleView?id=tracking_field_history.htm&type=5

2. Yes, if history tracking enabled on field on account, object would be "Account History"

3. See image below from GS Reporting



Edit: A small tip: You can't fitler directly on New/Old value in a rule fetch task, but you can do a contains filter on it withn a following rule action. Like below.



Userlevel 6
Badge +2
Hey @scott_sigsci, happy to give some more context on this:

1. Yeah, this is done in SFDC. If you click "Setup" in the top-right of the screen, and find the field list for the given object, there will be a button for "Set History Tracking":

** You'll know history is being tracked if the box is checked in the "Track History" column.

2. Sorry, I should have explained this a bit more/better. You'll do this in Gainsight, Rules Engine. What happens with History Tracking, is that a seperate object exists that will house the changes that are being tracked. So, whenever there's a change to a field that's being tracked, a new record is created on the history object that will include what field was changed, what the old value was, what the new value is, and when the change was made– and that's what you'll setup the rule to look for. Something like this:

** Note, the Object in the dataset is "Account History" instead of "Account"

3. One bit I kinda forgot, is that the fields "Old Value" and "New Value" can't be added as filters in this first dataset. To add these fields as filtes, just add a "Transform" task:



wrt:

Then you can add additional details as need through additional datasets and merges.

You'll probably want to include some other details in the rule to create CTAs– e.g. you'll probably need to have CSM ID to assign the CTAs. To do this, create another dataset from "Account" with all of the fields that you want to include, and create a merge with this and the "Transformed" history object dataset:



** You'll want to "keep all records" from the transformed history object dataset– i.e. if you put this on the left side in the merge task, select "Retain all records from the left dataset"

Userlevel 2
Badge
@pele This is fantastic....HUGE. This detail is really helpful. I'm working through it now. Will continue to keep you in the loop. :)

Userlevel 6
Badge +2
As an aside, @spencer_engel hosts office hours on Thursdays, and this is the perfect sort of troubleshooting for those sessions– here's the Community Thread for tomorrow's US office hours.

Userlevel 2
Badge
@pele Thank you for the effort here. This is confirmed to work!

The follow up below your original answer was a huge help to me (and I would imagine to others as well). This should serve as an answer to this type of question, as @scott_496fa0 noted below.

Userlevel 6
Badge +2
Cool beans! Glad this worked out!

Reply