# Templates with variables and links

**URL:** <https://connect.superhuman.com/t/templates-with-variables-and-links/45479>\
**Category:** Ask the Community\
**Created:** [January 2, 2024, 5:32pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479 "2024-01-02T17:32:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lin\_Silver](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/lin_silver/32/22236_2.png) [@Lin\_Silver](https://connect.superhuman.com/u/Lin_Silver)\
**Post date:** [January 2, 2024, 5:32pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479/1 "2024-01-02T17:32:15Z")

</div>

I am emailing interviewees with set templates. We used to send these emails with fields written as “XXX” marking for the hiring staff to replace those “XXX” with the staff’s name, or other information that changes based on person.

I wanted to streamline this by using variable fields often seen in email merges on other platforms. I did this by using RegexReplace ie templates.regexreplace(“{{First Name}}”,name) This works to replace variables, however, doing so makes the template a strictly text field and strips away any links added to the template.

Please let me know if there is a better way of doing this, with multiple variables, and keeping links intact. Thanks!

> **[Templates](https://coda.io/@silver7/templates)**

---

<div class="post-metadata">

**Author:** ![Piet\_Strydom](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/piet_strydom/32/19269_2.png) [@Piet\_Strydom](https://connect.superhuman.com/u/Piet_Strydom)\
**Post date:** [January 2, 2024, 5:47pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479/2 "2024-01-02T17:47:26Z")

</div>

Hi Lin,

What I have used in a doc for work (which mean I can unfortunately not share) is to use the compose column to create a text template. In this you can reference any column in the same table. The full CFL is also available so you can access information in any other table. I then use this column as the “content” in the email message.

 ![image](https://global.discourse-cdn.com/coda1/original/3X/7/3/734677ae81a2df05359d9130f1f7c6efbd04df1e.png)

---

<div class="post-metadata">

**Author:** ![Lin\_Silver](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/lin_silver/32/22236_2.png) [@Lin\_Silver](https://connect.superhuman.com/u/Lin_Silver)\
**Post date:** [January 2, 2024, 6:01pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479/3 "2024-01-02T18:01:25Z")

</div>

This won’t work for us as we have over 100 different templates! Its not sustainable to use formulas as the templates. And because of the large number of templates, everyone needs to be able to easily add/remove/edit templates as needed. Which is the purpose of a dedicated templates table.

---

<div class="post-metadata">

**Author:** ![Piet\_Strydom](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/piet_strydom/32/19269_2.png) [@Piet\_Strydom](https://connect.superhuman.com/u/Piet_Strydom)\
**Post date:** [January 2, 2024, 6:08pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479/4 "2024-01-02T18:08:12Z")

</div>

There are many, many ways to skin this cat.

You can move the compose column to a template table, use Format() to build the body/content of the mail. maybe even use a canvas column with a switchif() for different “types” of canvas column templates.

It all depends on what you mean with “variables”, how many there are and the frequency with which they are re-used across the various templates.

And of course, the template itself can also simply be a variable.

---

<div class="post-metadata">

**Author:** ![Lin\_Silver](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/lin_silver/32/22236_2.png) [@Lin\_Silver](https://connect.superhuman.com/u/Lin_Silver)\
**Post date:** [January 2, 2024, 6:30pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479/5 "2024-01-02T18:30:45Z")

</div>

The issue isn’t with the replacing of variables. Using regexreplace works perfectly to replace our numerous variables ie  
{{First Name}}, {{Last Name}}, {{Position}}, {{Age}}, etc. Some templates use multiple variables, some templates use none. They all appear in different places throughout the templates and is not predictable to use format to input these variables.

The issue arises with the links disappearing from the templates when using regexreplace for the variables.  
If there are no links in the template, this system is perfect.

I am more wondering if there is a way to preserve links when a canvas (or even just a text column) is converted to be a strictly text column.

Edit: A part of this system is that (without links) we can create a template in 10 minutes by just typing what we want to send via a mass email merge without needing to change formulas. Thats what the variable placeholders are for. If we need to include links however, this stops working since the links get stripped.

---

<div class="post-metadata">

**Author:** ![Lin\_Silver](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/lin_silver/32/22236_2.png) [@Lin\_Silver](https://connect.superhuman.com/u/Lin_Silver)\
**Post date:** [January 2, 2024, 6:50pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479/6 "2024-01-02T18:50:19Z")

</div>

Looks like I asked a question that was just recently asked and answered.

> [@How do you replace in rich text while preserving formatting?](https://connect.superhuman.com/t/how-do-you-replace-in-rich-text-while-preserving-formatting/38495/8):
>
> 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. [image] 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]) ... Take your original text. (Heystack) SPLIT on the text you are looking to replace (Needles). And the…

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [April 1, 2024, 6:50pm UTC](https://connect.superhuman.com/t/templates-with-variables-and-links/45479/7 "2024-04-01T18:50:48Z")

</div>

Closed on April 1, 2024, 6:50pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
