Replaces one value with another in the specified columns.
function (
table
as table, optionaloldValue
as nullable any, optionalnewValue
as nullable any,replacer
as function,columnsToSearch
as list) as table
Replaces oldValue
with newValue
in the specified columns of the table
.
Table.Transformation
Replace the text "goodbye" with the text "world" in the table.
Table.ReplaceValue(Table.FromRecords({[a = 1, b = "hello"], [a = 3, b = "goodbye"]}), "goodbye", "world", Replacer.ReplaceText, {"b"})
Table.FromRecords({[a = 1, b = "hello"], [a = 3, b = "world"]}, { "a", "b" })
Replace the text "ur" with the text "or" in the table.
Table.ReplaceValue(Table.FromRecords({[a = 1, b = "hello"], [a = 3, b = "wurld"]}), "ur", "or", Replacer.ReplaceText, {"b"})
Table.FromRecords({ [a = 1, b = "hello"], [a = 3, b = "world"]}, { "a", "b" })