Question

Removing Tags Via Rule

  • 16 October 2015
  • 14 replies
  • 128 views

  • Registered User
  • 4 replies
Has anyone found a good way to remove tags via rules engine? We can easily add them, but could not find a way to delete them or replace them over time. We are looking to create some custom dashboards using a set of specific tags, but they would need to be dynamic for changing conditions.

14 replies

Hi Daniel!  Are you looking to remove all tags from Customers or just a subset?



If you want to do a total wipe of all tag records, you could execute this type of script in Workbench or Developer Console:



List<JBCXM__CustomerInfo__c> UDToUpdate = new List<JBCXM__CustomerInfo__c>();

for(JBCXM__CustomerInfo__c UD : [SELECT JBCXM__Tag__c FROM JBCXM__CustomerInfo__c])

{

UD.JBCXM__Tag__c = null;

UDToUpdate.add(UD);

}



System.debug('Records to Update: ' + UDToUpdate.size());

update UDToUpdate;



If you wanted to only do this for a subset of Accounts, you can add a WHERE clause to further parse down the data that is being removed.



Let me know if this helps.
Userlevel 7
Badge +9
Scott, would you clarify for us (Dan and me), can this be done in the Gainsight rules engine? We asked Support, and they said no.
Matt there currently is not a way to remove values via the Rules Engine from the Tag field.  Feel free to shoot me an email smorris@gainsight.com if you'd like to discuss specifics around the script further.
Is there a way to do this via Apex Data Loader instead of Workbench?  
Userlevel 6
Badge +5
Hey Scott, Has there been any progress toward automating removal of tags via a rule? Or do you have a suggestion for if we are tracking "At Risk" through a tag what a better way would be?
Hi Ellen you could do this via a data loader.  Are you using Jitterbit?
At this point there isn't a better way to do it via the Rules Engine since we are dealing with a Multiselect Picklist field type.  You could utilize a custom checkbox field on the Customer Info record to mark a customer as "At Risk".  You could also have a rule that unchecks the box to make sure all "true" records are accurate daily.
I use either Apex data loader and dataloader.io
Hi Scott-



bumping this old topic, i think this solution might work for something I'm trying to do. Would this be a field that would be added in SFDC and imported into GS or is there an easy way to create a checkbox in GS?



Thanks
Hi Sam:



You can add the field to the Customer Info object under Setup -> Create -> Objects in SFDC.  I'd make the default value of the boolean field "unchecked" then from there you can have a rule update the checkbox to be true.  Alternatively you can add the checkbox to the Account object, but typically most customers prefer not adding fields to the Account.  Once this field is added to the Customer Info object you'll be able to then use it in reports and rules.  Let me know if you have any questions!



Scott
Thanks for getting back to me.



We aren't using customer info, I don't suppose there's a simple way to add the checkbox to just the "customers" object, is there? Or does that just mirror the account, such that if I added it to the account it would appear as an option in customers?



Any other workarounds you might have in mind? It would be great not to have to go completely back to the drawing board and create a custom table and then rebuild all my rules again.



Originally, my goal was to have an identifier that stops the same CTA from being opened over and over when I run my rules each night. I have a couple implementation-flavored playbooks that I want to run via CTAs that will all sit in our "Onboarding" stage so I'm looking for a secondary marker to use in my filters to accomplish this goal.



My first idea was just to exclude records that had the current rule's playbook already associated with that customer but I was using the previous rule's CTA plus a "complete" status and having two mutually exclusive filters based on CTAs seems like a no-go based on what I've read. 



Hopefully that is clear; I'm not certain what else to try. Any suggestions or help would be greatly appreciated.
Userlevel 6
Badge +5
You should be using "customer info" as I believe that is a default object in Gainsight. It would be fairly simple to create a new field there, whether hidden or public, you could populate. You might also be able to add a filter to your rule to keep this from happening. For example, we have a rule that creates a milestone when an Account enters and leaves Onboarding. When we first created it, it would write the milestone everyday. We then implemented a date field. Now when the rule runs there is a filter that says only add this milestone if the date of entering Onboarding was yesterday.
Like I said, we're not using customer info so if anybody has any other suggestions, I would love to not have to go back to re-invent the wheel.
Userlevel 6
Badge +5
You can always do the same thing and write it to the account object.

Reply