Power Query
Search…
List.ReplaceValue

List.ReplaceValue

Searches a list for the specified value and replaces it.
function (list as list, optional oldValue as nullable any, optional newValue as nullable any, replacer as function) as list

Description

Searches a list of values, list, for the value oldValue and replaces each occurrence with the replacement value newValue.

Category

List.Transformation functions

Examples

Replace all the "a" values in the list {"a", "B", "a", "a"} with "A".
1
List.ReplaceValue({"a", "B", "a", "a"}, "a", "A", Replacer.ReplaceText)
Copied!
{"A", "B", "A", "A"}
Last modified 3yr ago