---
schema_version: "1"
id: 86fda391e84df54bb852daaf1654aed0133104ab1017d84f6fb17092a04ced48
title: contains
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/spiff_function_ref_contains.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.spiff_function_ref_contains.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e34f66835e9e7e51d5b74501d0e5b6c4c3d1f5b802c00e12710fdc3a487ccbaf
description: Checks whether a string or list includes a specified value in Salesforce Spiff. This function returns true or false.
products:
  - Sales Cloud
  - Sales Enablement
release: "264"
---
# contains

Checks whether a string or list includes a specified value in Salesforce Spiff. This function returns `true` or `false`.

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

```
contains(string_or_list, search_value)
```

## Arguments

  
| Argument | Required? | Description |
| --- | --- | --- |
| string\_or\_list | Required | The string, list of strings, or list of numbers that you're searching. |
| search\_value | Required | The string or number you're searching for. Enclose string values in double quotes. |

## Example

Turn a ClosedByRepInPeriod list into a list of items with the `transform_list()` function, and check whether the list includes the string "Widgets". To also check whether the function returns a value, enclose the function in an `if()` statement that returns `1` or `0`.

```
=if(contains(transform_list(ClosedByRepInPeriod, Item__c), "Widgets") = true, 1, 0)
```

This formula can help make sure that payouts aren't made if the statement period includes the word "widgets".