Loop through rows, copy contents of column A to column B

Hi folks, I’ve read a lot of answers here, and I think the best option here would involve FormulaMap. In typical software dev, I would use a basic for loop.

https://coda.io/d/Customer-Service-Chat_dl7vSvRiNlw

The general idea is:

  • Click the button
  • Foreach row in Hello!, get the contents of the column “Original”. Do some transformations to that data, then paste the output to the “Output” column (in this case, transformation is replacing some text fields using RegexReplace)

The closest I’ve come is the following, but this of course gets all columns of the “Hello!” table

ModifyRows([Hello!],[Hello!].Output,[Hello!].Original.RegexReplace("{{name}}", Input.[Customer Name]).RegexReplace("{{day}}", Input.Day))

Any suggestions would be much appreciated

Hi @John_John can you please share the doc with access to everyone. Thanks!

Thanks for the heads up, I think that’s shared correctly now. If not though, let me know :slight_smile:

@John_John,
You can accomplish this with the Format() formula.
something along the lines of:
Hi {1}, I hope you’re having a great {2}!
then in your [Output] you just add a formula with Format([Original], Input.[Customer Name], Input.[Day])
As seen in the doc below.

2 Likes

Thanks Josh, that is helpful in some cases, I appreciate it. Does anyone know though how to do this in a more traditional for loop style?

Dear @John_John,

Maybe this post, using “loops” give you the right direction. Credits to @Federico_Stefanato

1 Like