Hello. I have a large set of data with many columns. I want to use the multi field formula tool to look for a specific case of a name, such as "The Rock" and change it to "Dwayne Johnson".
I already have an expression in a multi field formula that changes around names for me like so:
I want to add the formula to this tools expression if possible like so:
The reason why I want to do this is because when I add a second multi field formula tool right after the first one, I am unable to select any of the fields like I could in the first tool:
As you can see, in the second multi field formula tool, I am unable to select any fields. Any help would be appreciated.
Solved! Go to Solution.
@shaheer Can you provide a sample input and expected output result?
For example, input is:
Preferred Full Name | Age | Name2 | Name3 | Experience (years) |
Rock, The | 40 | Cates, Anna | James, Henry | 5 |
Gunn, James | 50 | Rock, The | Allan, Barbara | 4 |
After my regex replace formula Regex_Replace([_CurrentField_],'(\w+),\s?(\w+)','$2 $1') which is used in the multi field formula tool and selects the columns with names, output would look like:
Name1 | Age | Name2 | Name3 | Experience (years) |
The Rock | 40 | Anna Cates | Henry James | 5 |
James Gunn | 50 | The Rock | Barbara Allan | 4 |
Next, I've tried using the formula tool like so:
Which should change "The Rock" to "Dwayne Johnson" (I am having trouble with the syntax). I will then apply this same formula to all other columns by pressing the + symbol and changing the column name accordingly.
Hey @shaheer, this is what I mentioned in my previous post and gets your desired answer:
I'd definitely recommend sticking to your current approach of Multi-Field formula - doing this with a regular formula tool several times is way more inefficient and there's no need.
One thing to note is what I mentioned before - if there's a lot of names that you want to replace then I'd recommend doing a lookup table with find & replace rather than relying on an if statement.
@shaheer The Regex_Replace() formula you used is not correct. I provided a sample workflow for your reference
Thank you so so much