List.FindText

List

Returns all items in the list that contain the given text string. Items must be text values; comparison is case-insensitive.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

List.FindText(list as list, text as text) as list

Parameters

NameTypeRequiredDescription
listlistYesThe list of text values to search.
texttextYesThe text string to search for within each list item.

Return Value

listA list of text items from the source list that contain the given text.

Remarks

List.FindText filters a list of text values, returning only those that contain the specified text as a substring. The search is case-insensitive"apple" will match "Apple", "APPLE", and "pineapple".

All items in the list must be text values; non-text values (including null) will cause an error. If your list may contain mixed types, use List.Select with a guarded Text.Contains call instead. Returns an empty list if no items match.

List.FindText is equivalent to List.Select(list, each Text.Contains(_, text, Comparer.OrdinalIgnoreCase)). Use List.Select directly when you need case-sensitive matching, more complex conditions (e.g., starts-with or ends-with), or when working with lists that may contain non-text values. List.FindText is most useful as a quick, readable substring filter on a clean list of text.

Examples

Example 1: Find items containing "apple"

List.FindText({"Apple Juice", "Orange Soda", "Pineapple Tart", "Grape Jam"}, "apple")
Result
Result
1{Apple Juice, Pineapple Tart}

Example 2: Search product codes

let
    Products = {"PROD-001", "ITEM-002", "PROD-003", "SVC-004", "PROD-005"},
    ProdItems = List.FindText(Products, "PROD")
in
    ProdItems
Applied Steps

The final output — uses List.FindText to return only those product codes that contain the substring "PROD".

Result
1{PROD-001, PROD-003, PROD-005}

Example 3: Case-insensitive matching

List.FindText({"Alpha", "BETA", "gamma", "Delta"}, "a")
Result
Result
1{Alpha, gamma, Delta}

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks