---
schema_version: "1"
id: b4227725b02d7df5a4d98224e917e360e08073f59988053bb5e2cf08ac0627d3
title: CONTAINS
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/customize_functions_contains.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.customize_functions_contains.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 54c7ca831df916eea6e5bbc44809c897224d25676dcc32e93edfd9947114fb81
description: Compares two arguments of text and returns TRUE if the first argument contains the second argument. If not, returns FALSE.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# CONTAINS

Compares two arguments of text and returns TRUE if the first argument contains the second argument. If not, returns FALSE.

## Use

`CONTAINS(text, compare_text)` and replace text with the text that contains the value of compare\_text.

## Tips

- This function is case-sensitive so be sure your compare\_text value has the correct capitalization.
- When using this function in a validation rule or workflow rule, fields that are blank are considered valid. For example, if you have a validation rule that tests to see if the serial number of an asset contains “A,” all assets that have a blank serial number are considered valid.
- The CONTAINS function doesn't support multi-select picklists. Use [INCLUDES](https://help.salesforce.com/s/articleView?id=platform.customize_functions_includes.htm&release=264.0.0&type=5 "Determines if any value selected in a multi-select picklist field equals a text literal you specify.") to see if a multi-select picklist has a specific value.

![Formula Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_example.png)

Formula Example

```
IF(CONTAINS(Product_Type__c, "part"), "Parts", "Service")
```

This formula checks the content of a custom text field named Product\_Type and returns Parts for any product with the word “part” in it. Otherwise, it returns Service. Note that the values are case-sensitive, so if a Product\_Type field contains the text “Part” or “PART,” this formula returns Services.