Hi all, I am trying to pull HTML data from Airtable to use inside an Outlook module to send an email.
For example, my Airtable variable is {{HTML}} and returns:
"<p>Hello {{3.name}},</p><p>Order number: {{4.ordernumber}}</p>"
3.name and 4.ordernumber exist as variables in the same scenario before my outlook module. However, when I put the HTML variable inside the Body field of Outlook, it sends the email with literally {{3.name}} and {{4.ordernumber}} instead of “Michael” and “12345.” Do you have any idea what I might be doing wrong?
It’s because, since it’s picked at runtime, these variables are not interpreted. Make takes the string as-is and doesn’t try to replace them with the actual variables in your scenario.
I don’t think you will be able to have Make automatically map them, so you may need to replace these placeholders with the corresponding values.
One way would be to change a bit your placeholders; something like “{name}” and "{ordenumber}, and use the replace function in your mapping to that they are replaced by the actual variables.
I really appreciate the response, I am still stuck on this and would love to figure it out as it would allow me to store our HTML-based emails in 1 collective place that we can view and edit (such as airtable), but without this piece working then this idea won’t be possible.
I tried a replace function like you recommended, a great idea but unfortunately it still sends back {{20.name}} instead of “Michael” in my test
My HTML variable contains “{20.name}”, which exists in the scenario but I just can’t convert this to actually be used. Do you have any other ideas of things I could try? Open to anything!
Oh, unless you mean actually mapping the variables themselves inside the replace function. Now that I read your response again I’m sure this is what you meant.
This idea would certainly work which is good, however in some cases I am using 10-15 variables per email (personal information, address, order numbers, reference numbers, etc.) so it would make it a bit of a mess to potentially see a chain of “replace(replace(replace(replace(replace(” (in many cases I am also formatting those variables, things like formatDate or startcase/splits which would add to the replace chain too.)
I suppose that would work as a last resort type of thing, or I could have a set variables module that keeps them separated until called in the replace function. Great idea, let me know what you think or if you can think of anything else
In fact, you will not be able to have Make replace the {{20.name}} with the actual variable content. And you should not do like this, because imagine you need to remove the module and add it again (example you accidentally removed it), it will no longer have the id “20”, so it will fail.
What you can do is to use the replace function to replace directly {20.name} with the actual data. And not try to generate a Make variable that would be picked.