---
schema_version: "1"
id: 41aaf5b83c213706c94dd242d7122d2e28f414c94481d0462363e7c8f909707a
title: single
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_function_ref_single.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_single.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4f1687604f0864abb32b6b5e302c6c7e0581e0eabd47d78f04f46fa928f82b89
description: 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.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# single

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.

### 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>

## Syntax

```
single(list, string)
```

## Arguments

  
| Argument | Required? | Description |
| --- | --- | --- |
| list | Required | The list that contains only one record. |
| string | Optional | An error message that tells admins that the list includes more than record and explains how to remove extra records. |

## Example

An opportunity can have multiple line items, but maybe you want to verify that an opportunity includes only one line item of a specific type.

First, use the `filter()` function with the Opportunities and Opportunity Splits relationship to return a rep's deals that have "ARR Amount" in the description.

```
=filter(OppToOppSplits, OppSplitToSplitType.Description == "ARR Amount" AND SplitOwnerId = rep.Id)
```

Next, use the `transform_list()` function to turn the filtered list of deals into a list of records that have "ARR Amount" in the description.

```
=transform_list(filter(OppToOppSplits, OppSplitToSplitType.Description == "ARR Amount" AND SplitOwnerId = rep.Id), OppSplitToSplitType.Description == "ARR Amount")
```

If you expect to have only one record with this description, use the `single()` function to verify that the list includes only one record. If there's more than one record, return an error message to help the admin troubleshoot.

```
=single(transform_list(filter(OppToOppSplits, OppSplitToSplitType.Description == "ARR Amount" AND SplitOwnerId = rep.Id), OppSplitToSplitType.Description == "ARR Amount"), "We found multiple split records with ARR Amount in the description.")
```

#### See Also

- [filter](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_filter.htm&release=264.0.0&type=5 "Further filters records in a Salesforce Spiff data filter, list, or relationship and returns a list of records that match a specified condition. This function helps refine an existing data filter.")
- [transform\_list](https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_transform_list.htm&release=264.0.0&type=5 "Applies an expression to each record in a data filter in Salesforce Spiff and returns a new list with the results. For example, identify a specific field from a list of records and return a list of the values for only that field from those records.")