Question

Rule to fire only once when box is checked


Badge
I need to write a rule that fires and triggers a CTA when SF users check a specific box. The rule will be scheduled to run each morning. I recall that we could set up a field (maybe) to pull in "yesterday's value." I could then write a rule that states - Fire if this box was null yesterday and was checked today. The CTA only needs created once per client and the box will stay checked for the duration of their life cycle.

8 replies

Userlevel 6
Badge +1
Hi Jamie,



Is this flag/box available at the Account or Customer level? If yes, you can build a rule on the Call to Action object instead. 



What you'll need the rule to query is a list of Accounts for which this flag/box is checked, but there is no CTA in the system already. As per the latest Gainsight release, which went out this morning I believe, you can now act on absence of data, i.e., extract Account records that don't have a record at all based on the provided filter criteria (more details here). You can then add the CTA action, with the criteria that this should apply only where data is unavailable (there's a checkbox at the bottom of the action container).



Hope this helps.



Thanks,

Manu
Badge
Hi Manu,

Yes, it's at the Account level. This is fantastic! Thank you for your quick response. I'll give it a shot today.
Badge
Hi Manu,

In theory, this was a great idea and I successfully set it up. However, the CTA is fairly new so there are a number of accounts that would qualify for the output since not all accounts had the CTA fire in the past. I considered creating a rule to create a CTA for all current accounts with the CTA name in question and then creating a rule to close all of those CTA's with that name... so only new accounts moving forward would qualify for the rule in question. Can you think of reason NOT to do that, or can you think of a simpler way? Thanks!!
Userlevel 5
Badge +2
Jamie,



You can close these CTAs from the mass edit too also, you don't need to create another rule to then close them. This would be what you would want to do to ensure this works for day forward strategy. 
@manu_mittal I have the same issue as Jamie and when I click that link it says the content is no longer available. I will have the same issue that I do not want data created for all accounts, I just want from this day forward if the box is checked, to trigger a CTA. Similar to how a trigger in SFDC would work. Any ideas?


Badge +3
Hi @megan_hamby



One possible solution...



If the checkbox is a Salesforce field, what you can probably do is turn on history tracking for the field you're referencing. Then, when you build the rule to trigger a CTA, query the object's history object instead of the object itself (e.g. if the field is on the SFDC Account object, you'd create a dataset off of Account History instead of Account)



In this dataset, you'll want to include the fields "Old Value", "New Value" and "Created Date", and add a filter for "Account History::Changed Field = *field you want to track*".



Then you run a Transformation task on the data set to add the filters:



(** pretty sure Transformation task has to be done b/c the fields Old Value and New Value are ANYTYPE.)



This should give you a list of Accounts where the checkbox wasn't checked, and at some point "yesterday" the checkbox was checked.



**for the example below, I ditched the filter for created date as leaving it on in our instance yielded zero results.







Hope this helps!


Badge
Hi @megan_hamby. I actually ended up doing something different that works great. I had my Salesforce Admin create a new custom field that auto-populates the current date when my checkbox field is checked. I use this date field as a filter (Subtract N days from rule date with N = 1) so that my rule is only triggering the CTA when the date is "yesterday."


Thank you!


Reply