How do you replace in rich text while preserving formatting?

Hi Team, I found a workaround to this that could almost be called elegant. I thought I would post it here in case the next person who comes across this post could benefit.


The idea is simple. I have added nice spacing but it is just a long chain of SPLIT/JOIN pairs.

[Title Template].Split('{{First Name}}').Join(thisRow.[First Name]).Split('{{Last Name}}').Join(thisRow.[Last Name]) ...
  1. Take your original text. (Heystack)
  2. SPLIT on the text you are looking to replace (Needles).
  3. And then immediately JOIN using the replacing text (Replace With).
  4. Repeat as necessary


As a happy bonus I also found this method doesn’t drop formatting or @References that can happened with other methods