Forum Discussion
DanielCooper
3 years agoRegular Visitor
Conditional replace text based on if the value is present in another column in the same row
Hi, I'm having trouble using the Table.ReplaceValue function with a condition. I want to replace the values in one field (Print), with the values in another field (REPLACE Print), but only i...
- 3 years ago
Hello! Please give this a try...
= Table.ReplaceValue(#"Previous Step Name", each [Print], each [REPLACE Print] ?? [Print], Replacer.ReplaceValue,{"Print"})This statement says exactly what you are trying to do. The other difference between it and your script is that you had the replacer function as Replacer.ReplaceText (partial value) instead of Replacer.ReplaceValue (entire value).
BEFORE:
AFTER:
jennratten
3 years agoSuper User
Hello! Please give this a try...
= Table.ReplaceValue(#"Previous Step Name", each [Print], each [REPLACE Print] ?? [Print], Replacer.ReplaceValue,{"Print"})
This statement says exactly what you are trying to do. The other difference between it and your script is that you had the replacer function as Replacer.ReplaceText (partial value) instead of Replacer.ReplaceValue (entire value).
BEFORE:
AFTER:
DanielCooper
3 years agoRegular Visitor
Hey!
This worked great, thank you
Best,
Dan
- jennratten3 years agoSuper User
Wonderful! Please consider giving my solution a thumbs-up and marking it as an accepted solution.