Table variables store formulas related to a table that can be used throughout the knowledgebase. They are useful for creating custom summary reports and items on the Dashboard, such as Numerical Result Widgets.
Suppose you want to create a custom summary report for the Contracts table that includes all expiring contracts. In the report, you want to include contracts that expire within 30 days, within 90 days, and within 120 days. For each set of contracts, you can create a table variable that uses a saved search to find all the relevant contracts and displays them in the report. Every time the report is run, the values are updated to reflect the number of expiring contracts in each time frame. |
The table variable library is located at Setup > System > Manage Table Variables. This screen contains all table variables and allows you to create new variables. Whenever a table variable is created elsewhere in the system, it appears in this library where it can be edited or deleted. You can also view existing table variables from the Global Variables tab of the Formula Help wizard.
Table variables use a combination of saved searches and formulas to calculate a single value that can be used in other system-wide operations. In cases where a saved search is used, the search finds a set of records that are then acted on by a formula to calculate the result as a number value. Otherwise, the formula calculates a number value based on all records in a table.
To create a new table variable:
Select whether or not the system interprets null values, or empty fields, as zero. Interpreting a null value as zero includes the value in the data set as zero; otherwise, it's excluded. For instance, imagine you're using a field's value in four records to calculate an average: 10, 10, 20, and null. If you interpret null values as zero, the system calculates an average of 10. Otherwise, it calculates an average using only the first three records and returns a value of about 13.3.
This option has no effect on calculating the total of a field's value or when selecting the Record Count option. |
Consider a situation where you want to display the number of contracts assigned to the logged in user. Maybe you want to display the number with a Numerical Result widget on the user's dashboard. Let's step through the process of creating a table variable to accomplish this.
$global.my_id
variable.When creating your Numerical Result widget, you can now click Choose Variable on the Options tab and find the variable you just created.
Related articles |