Forum Discussion
Invoking custom function from within a query
- 8 years ago
Function.Invoke expects a list as second argument.
It should be OK if you put the argument between curly brackets.
let Source = .... my = Function.Invoke(xReplace,{#"Renamed Columns"}) in myOtherwise you might consider not to use Function.Invoke and just call the function directly.
I don't think Function.Invoke has any added value in this case.
Function.Invoke expects a list as second argument.
It should be OK if you put the argument between curly brackets.
let
Source = ....
my = Function.Invoke(xReplace,{#"Renamed Columns"})
in
my
Otherwise you might consider not to use Function.Invoke and just call the function directly.
I don't think Function.Invoke has any added value in this case.
By the way, for multiple replacements you might consider using List.Accumulate.
You can find an example in my answer on this post on StackOverflow.
- gvg8 years agoPost Prodigy
MarcelBeug wrote:By the way, for multiple replacements you might consider using List.Accumulate.
I understand this is to change individual characters. I need to change the whole phrases.- MarcelBeug8 years agoCommunity Champion
In the example I may have used List.Accumulate to replace single characters.
In the video below, you can find more information about List.Accumulate with an explanation on how to change substrings starting at at 3:23.