Charts: name and split series via template syntax

  • 2
  • Question
  • Updated 4 years ago
  • Answered
After reading the answers to Ant's post, I think that I should be able to rename the series in my charts with merge syntax, using this:


The field is a checkbox. I'd like one series that displays "Scheduled" for every true value, and one that displays "Unscheduled" for every false value, instead of something that says "true (COUNT)" and "false (COUNT)"

How do I accomplish that?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 4 years ago

  • 2
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Jim,

You absolutely can accomplish this with our template merges. If your Checkbox field is Scheduled__c, the template would look like this:
{{#Scheduled__c}}Scheduled{{/Scheduled__c}}{{^Scheduled__c}}Unscheduled{{/Scheduled__c}}
For other cool things you can do with templates, check out our tutorial on the subject.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
If my field is a picklist instead of a boolean, is there a way to split the field with a template merge?
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Yes, there is. If you just want whatever value is in the field displayed, you can use the following template (assumption: the Picklist field's API Name is Scheduled__c):
{{Scheduled__c}}
You can also put static text outside those merge values. For example...
All {{Scheduled__c}}
...would output "All " followed by whatever the value of that row's Scheduled__c field is. If you've got some blanks in there and you want to provide a default value, you can use ^ to check for blank values. For example (where N/A is whatever text you want to display):
{{#Scheduled__c}}{{Scheduled__c}}{{/Scheduled__c}}{{^Scheduled__c}}N/A{{/Scheduled__c}}
Does that help?
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
That helps! Thanks.