Formula Traits
Build custom formulas on various objects.
Formula Traits
Formula Traits allow you to build custom formulas on various objects. This feature will be available for all objects! Formula Traits enable users to perform basic mathematical operations, if/than (ternary) operations, and comparisons, providing greater flexibility and power in data management.
Creating a Formula Trait
How To | How To Visual |
---|---|
How to create a Formula Trait:
| |
Previewing your Formula Underneath the formula builder you have the option to select or search for an object (such as an Account) and the formula builder will use that object’s data to produce a preview of your formula. That object will persist in the UI, so the next time you build a formula the preview will auto-populate with that object’s values. |
If you're updated your Formula Trait, calculations can take from a few minutes to up to an hour.
Operators for Formula Traits
Operators will show you all the formulas currently available for your use. You can also type the notation directly into the formula builder. Currently we allow:
Addition
Subtraction
Multiplication
Division
If/than (Ternary)
Coalesce (returns the first non-null value from a set)
Aggregation Traits
Aggregation Traits (previously known as "calculated traits") are calculations of properties on related objects. For example, for a given account, you might want to get the sum of all its related tasks or roll up a trait to use it as a data point on another object. Available aggregations include:
Sum - total sum of values
Unique - count of distinct values
Count all - total count of all items
Average - mean value calculated from a set of numbers
Rollup - hierarchical summarization of data
Aggregation traits can be used on the Users, Tasks, Active Conversations, Notes, and Custom Objects. Once created, you can use this in Health Scores, automation, Widgets, or anywhere a trait can be used!
How To | How To Visual |
---|---|
How to create an Aggregation Trait
|
When there are no objects included in a calculated trait where the operation is sum, average, or a roll up, the value will be set to null instead of zero, allowing traits with no values to be excluded from health scores or filters that ignore nulls.
Complicated Formulas & Use Cases
Formula & Aggregation Trait FAQs
Q: What will happen if I build a formula that uses bad syntax? A: When building formulas, the formula builder will tell you if your syntax is acceptable or if it requires adjustment. In the bottom of the formula box you’ll see a note in green that says “valid syntax” if your formula’s syntax is valid, and red text if it is invalid. Users will be prevented from saving formulas that contain invalid syntax.
Q: What if I use unsupported notation? A: If you use a notation that isn't supported, the formula builder will behave the same way as with bad syntax. You'll get an error message, and the formula won't be saved until you fix it.
Q: How quickly will the formulas calculate? A: We calculate the formula immediately upon its creation or after being edited. It should take anywhere between a few minutes to an hour to calculate. You should be able to see in the Trait list in Settings whether the formula has finished calculating for all objects. We reevaluate the formula hourly for non-churned target and daily for churned targets.
Q: Talk to me about building formulas with date properties. A: Currently, formulas between two dates produce large numbers because the output is not set up to display in days. This is an area for future improvement.
Last updated