Selecting One Item or Record from a List or Array in Salesforce Spiff

Functions in Salesforce Spiff commission logic often require that you reference one item or record in a list or array, such as the first invoice, latest payment record, or current user. Sometimes you must make sure that you select an item even when the list or filter contains only one item.

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
  • The choose() function selects a specific item from a list.
  • The single() function confirms whether a list contains one item and show an error message.

List values in Spiff aren't sorted by any default order. To make sure that you select the appropriate value, combine the choose() function with sort() so that you sort the list values before you select a specific item.

See Also