When creating a payout rule, sometimes you need a function that returns a list or array instead of a single data point. These list or array functions are typically used within other functions to create a formula that calculates a single final output.
Required Editions
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer Editions |
| Available for an additional cost in: Professional Edition with Web Services API Enabled |
For example, see all the quotas from a specific team and then use the sum of the resulting array as a worksheet calculation. Or, create a datasheet field that lists all reps on a specific team and then returns the number of reps.
Functions that return lists or arrays can consume more processing memory than normal calculations that just return one data point. To make your system as efficient as possible and keep the time it takes to recalculate your statements short, turn off tracing for these calculations.
Lists versus Arrays
In Designer, lists and arrays have specific meanings.
A list is the output of a function or formula that returns all records in an object for the items that qualify. For example, the members() function returns a list of members in a team.
=members("AE - North America")
The list shows only the name of the object that the function queries. In this example, only the label User appears for each item returned because the function returns all user records for members of the team. A user record contains several attributes that aren't included in the list, such as, ID, Name, Effective Date, and so on.
An array is the output of a function or formula that shows the one data element you specify in the function for every returned record. For example, the transform_list() function returns an array of the members list and shows the value of a specific attribute for each user, such as their name.
=transform_list(members("AE - North America"), Name)
In this example, the transform_list() function returns each user's name but doesn't show any of the other attributes from each User record.