@Adam_Dachis I should clarify, I have only managed the message portion in the actual Twilio tool. I would love some help on how to do this in the Airtable formula field. I understand everything else, but would really appreciate some more on step 2.
Thank you!
Harry
@Kieran_Ball
Hi Harry, Iâm glad this was helpful!
I assumed youâd done it in a formula because what you pasted is very similar to a formula. :slightly_smiling_face: I havenât used the Twilio block in awhile so I didnât realize that was the format it takes. Hereâs the formula version of what you put in your original message:
'Hi '&{First Name}&' '&{Last Name}&', you have an appointment with '&{Name of doctor}&' on '&{Date of appointment}&'. Please call our offices if youâre running late on 07xxxxxxxxx.'
I didnât test that so itâs possible I made a typo. If it gives you any errors itâs either because I put a single quotation mark in the wrong place (or forgot one), left out an ampersand, or something like that. Basically, if you just need to make a message that has variables in it you put the static text in âsingleâ or âdoubleâ quotation marks and the field names in {curly brackets}. You use & in between each static text and field name (variable) to tell the formula that you want to concatenate (combine) these things. I use the word concatenate because itâs the technical term but also because itâs the name of a formula function that does the same thing in a different way. :slightly_smiling_face:
If you take a look at the Airtable formula field reference youâll find the CONCATENATE function in the text functions and operators section. I mention this because some people find CONCATENATE easier to work with. You could use it to make your variable message into a formula like this:
CONCATENATE('Hi ', {First Name}, ' ', {Last Name}', you have an appointment with ', {Name of doctor}, ' on ', {Date of appointment}, '. Please call our offices if youâre running late on 07xxxxxxxxx.')
The difference is just that the ampersands become commas, everything is surrounded by (parenthesis), and CONCATENATE is prepended to the whole thing. Functions always work like that in formulas. You type their names in all caps and follow them up with parenthesis: CONCATENATE(). Everything inside the parenthesis are parameters for the function. CONCATENATE happens to have a (virtually) unlimited number of parameters because itâs just combining them all together in a linear fashion. Most functions have a specific number of parameters that need to be specified in their designated position and some functions have no parameters at all.
The formula field reference page provides an overview of everything so itâs a good thing to bookmark. Even though the formula field does a really good job at helping you as you type, it can be hard to remember the name of every function. Iâve written a more in-depth version of this documentationâwhich is still being edited otherwise Iâd share that as wellâand have been writing tons of formulas for year. I canât remember 25% of the names so itâs useful regardless of your experience. But even if you donât bookmark it youâll find a link to it in the formula field options when writing your formula. :slightly_smiling_face:
You can do some really interesting and powerful things with formulas so itâs worth learning a little more about thereâs anything in Airtable youâre hoping to be able to do but arenât show how to approach it. The power userâs guide is a great place to start if you want to learn more. The other sections provide a lot of helpful foundation for the ways youâd be able to leverage formulas, but you can start with the last section to learn more about formulas right away.
If you have any specific questions, please feel free to ask. And if there are any resources (e.g. an article, video, etc.) you wish you had that would help you accomplish anything in Airtable, please let me know. I keep track of that stuff and try to create the resources that people need the most.
:slightly_smiling_face:
Adam