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

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.

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

```
transform_list(list, expression)
```

## Arguments

  
| Argument | Required? | Description |
| --- | --- | --- |
| list | Required | A data filter or list to evaluate. Use any function that returns a list or enter a list manually. A list can contain strings, numbers, currencies, records, or objects. Enclose the list in brackets with comma-separated values. |
| expression | Required | The field from records in the list that you want to include in the return value, or a formula that modifies a field. |

## Example

Return the Deal Name for the opportunity with the highest ARR in a period, across all reps. First, use the `sort()` function to return a list of all deals in the period, sorted from lowest ARR value to the highest.

```
=sort(ClosedInPeriod_AllReps, ARR__c)
```

Add the `transform_list()` function to return the Name field for every record in the sorted list. The return value is a list of opportunity names in ascending order from lowest to highest ARR.

```
=transform_list(sort(ClosedInPeriod_AllReps, ARR__c), Name)
```

Finally, add the `choose()` function to return the deal with the highest ARR. Because the record with the highest ARR is last in the transformed list, pass -1 for the `choose()` function.

```
=choose(-1, transform_list(sort(ClosedInPeriod_AllReps, ARR__c), Name))
```

#### 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.")
- [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.")