How to use a variable to build a hyperlink in an Email Body Template?

I have a Bot action to send an email.  It uses an email body template to format the email.  Within the body I have a hyperlink which I want to dynamically construct using a <<[variable]>> to personalise the hyperlink per row.

In the Google Doc email body template, a normal hyperlink is defined with the following URL content: https://docs.google.com/forms/.../viewform?usp=pp_url&entry.15946277=OSM<<[booking_id]>>gcor71_0-1709598823645.png
The expected result if for the hyperlink to resolve to .../viewform?usp=pp_url&entry.15946277=OSM123456  (were the <<[booking_id]>> = 123456)..

Unlike elsewhere in the template, the <<[variable]>> is does not resolve.  When clicked in the received email, the URL is still .../viewform?usp=pp_url&entry.15946277=OSM<<[booking_id]>>  .

How can I approach this and continue to use the Google Doc with the link URL being fully resolved?  I know I could use an HTML body, but I prefer the control and simplicity of the Google Doc template approach.

Thanks in advance.

 

 

Solved Solved
0 7 941
1 ACCEPTED SOLUTION

Great tip!  After a bit of tweaking, notably the inclusion of a second '&' to concatenate the end of the function correctly, it worked very nicely.  Never occurred to me to bring the << >> outside the complete function like that.

<<HYPERLINK(“https://docs.google.com/forms/.../viewform?usp=pp_url&entry.15946277=”&[id]&,”Driver Registration Form”)>>

Thank you!

View solution in original post

7 REPLIES 7

Are you using:

<<HYPERLINK(“https://docs.google.com/forms/.../viewform?usp=pp_url&entry.15946277=OSM "&[booking_id],"Driver Registration Form")>>

If not, replace the url in the function above with your actual URL and see it it works

Great tip!  After a bit of tweaking, notably the inclusion of a second '&' to concatenate the end of the function correctly, it worked very nicely.  Never occurred to me to bring the << >> outside the complete function like that.

<<HYPERLINK(“https://docs.google.com/forms/.../viewform?usp=pp_url&entry.15946277=”&[id]&,”Driver Registration Form”)>>

Thank you!

So has anybody tried this with the desktop mode?  It does not work for that!

Desktop mode has no bearing on the creation of email.

Correct @Steve , it does not affect the creation of the email, but it does affect the creation of the URL in the email.  

If I have an application that is NOT in desktop mode.  Then I can, on an email template, copy the URL from a specific view, and dynamically reference the [KEY] field in a <<HYPERLINK(CONCATENATE(“URL up to &row=”,[KEY],”Rest of URL"),”here”)>>

Cannot do that when referencing a view in desktop mode.  We have found that the URL is different for each record you are trying to access with no real way to anticipate what the change will be.  So, when creating a dynamic email URL link you have to shorten the URL address, between the first _ or -  and &row= then call the [KEY] field and add the rest of the URL.  

<<HYPERLINK(CONCATENATE(“URL up to first _ or - {deleting everything in between up to} &row=”,[KEY],”Rest of URL"),”here”)>>

Try using a LINKTO...() function to generate the URL instead.

Interesting suggestion.  We have tried this already, with no good results, but we did not spend a lot of time on it.  We will focus some time on your suggestion.