Create a Variable (Field)Last Updated: September 16, 2019
To understand how Spiff uses Variables, remember the following:
- A Variable is just an attribute on an object that you, the user, define.
- You can think of objects as sheets or tabs within Excel and you can think of attributes as columns. So, for example, you might create an Excel tab of Deals. Each row represents a specific deal (and a specific instance of a deal object). Each column represents an attribute of that deal. E.g., Name, Date, Amount, Closer, etc. Variables just allow you to create a new attribute on that Object.
Sometimes you don’t necessarily want to add an attribute to an object but you just want a Constant number or a sum of other numbers and you want these things to be globally available. In Spiff, you do this by adding these kinds of things as attributes on the Statement object. So it’s like adding a custom column on the Statement object.
The value of a variable in Spiff is defined by whatever formula you wish it to have! CRM fields, numbers, other variables, and many Excel-like functions can all be used in creating a variable's formula.
Creating / Updating Variables
You create Variables in Spiff Designer by clicking on the Variable icon:
Once here, you click on the "Add New Variable" button at the bottom of the page.
From here, you can create the name of your Variable, define its formula, and specify additional information.
In addition to its formula, a variable is further defined and qualified by several other pieces of information. These include the following:
Friendly Name: This is the name for a Variable that will appear on Statements, it can be set to whatever makes the most sense to the user.
Variable Name: This is the name for a Variable which other Variables, Rules, Scopes, Conditions, and Tables will reference. A Variable name must start with a letter and be composed only of letters, numbers, and underscores (no spaces).
All Variables are required to have both a Friendly Name and a Variable Name.
Applies To: The location where a function’s results will be placed. If “Deals” is selected, you can think of the results as new information added to each deal/opportunity in your CRM.
Available on Statements: Makes the output of a Variable visible on a statement.
Format: Sets the format for how a Variable result will print to a statement:
- "(None)" prints the result out in the same format in which it was calculated.
- "Currency" prints the result as a currency; Spiff supports most currencies, these can be converted using the convert_currency function.
- "Number" prints the result as a number.
- "Percent" prints the result as a percentage.
Precision: Number of decimal points that a Variable formula's results will keep; this is automatically set to 2 for Percent.