---
schema_version: "1"
id: 26b2505800dbba8fa25e727056228541add1a88f562e2a885471bef0c6e441b8
title: Selecting One Item or Record from a List or Array in Salesforce Spiff
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_functions_one.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_functions_one.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 2695407ac81dbe4b2a87c9615f449acf2d9f5f4d2fdbc7eb4749879dd6fd4b85
description: 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.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available for an additional cost in: <strong>Professional</strong> Edition with Web Services API Enabled</td></tr></tbody></table>

- 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

- [choose](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_choose.htm&release=264.0.0&type=5 "Returns a value from a list based on a specified index in Salesforce Spiff. List values in Spiff aren't sorted by any default order. To make sure that you select the appropriate value, combine this function with sort() so that you sort the list values before you select a specific index.")
- [error](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_error.htm&release=264.0.0&type=5 "Returns a custom message for a statement calculation error in Salesforce Spiff. This function stops statement calculations and helps you alert admins that information is missing or preventing the calculation from executing.")
- [single](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_single.htm&release=264.0.0&type=5 "Returns the first and only record of a list in Salesforce Spiff. This function validates that only one record is returned and converts the list of records into an individual record.")
- [sort](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_sort.htm&release=264.0.0&type=5 "Organizes records in a Salesforce Spiff data filter by a date, string value, or number value and returns a list of sorted records.")