May 03, 2022 09:33 PM
Hi all! I’m new to Airtable and trying to figure out how to pull multiple variables out of a single long text field.
I’m pulling the Description from an event in Google Calendar and syncing it into a Description field in Airtable. This field will have some things defined in a predictable pattern, such as the Zoom URL, name of the presenter, etc. - each corresponding to a field that exists in Airtable. What is the best way to set this up to be parsed through in Airtable? Is there a tutorial out there that could point me in the right direction?
Feel free to suggest something else if I’m going about this the wrong way. Thank you!
Solved! Go to Solution.
May 06, 2022 01:47 AM
Thank you @Vivid-Squid & @Justin_Barrett ! This was really helpful. It took a couple of formula fields and some automations, but here’s what it looks like:
–
Workshop: My Workshop Name
Zoom URL: https://zoom.com/s/something-here
Thanks to an automation, that field syncs from Gcal to Airtable into a record that I named Description.
Then I have a formula field named “Workshop Name” with the following code: REGEX_EXTRACT(Description,'Workshop: (.*?)<')
. The <
works because Gcal converts the line break into a <br>
and occasionally will add unnecessary html formatting that I don’t want.
Thanks to another automation, my Workshop link field (referencing the Workshop table) is updated to match the newly cleaned up Workshop Name. (Tangent: I initially had trouble with my Workshop table getting filled with garbage as I debugged this, but I used this tip and made the primary field in the Workshop table a formula so that it could not be added to if what is defined in the “Workshop Name” does not exist in the Workshop table.)
Finally, I also have a formula field “Zoom URL” with the following code: REGEX_EXTRACT(Description,'Zoom URL: <a href="(.*?)"')
. This works because Gcal converts the link into html anchor tags.
–
All-in-all, the hardest part was figuring out the right regex syntax, but that link you shared helped a lot with that. Thanks again!
May 05, 2022 04:05 PM
Hi @David_Needham ,
Take a look at the Formula documentation on FIND() for text: https://support.airtable.com/hc/en-us/articles/203255215-Formula-Field-Reference#text_functions
You will need to do a series of formulas to get everything.
One thing I do to create long formulas is to break out each item in the process into its own formula field. Then once you get the desired result, you can copy the formulas into one big formula.
May 05, 2022 04:47 PM
You might also experiment with regular expressions and Airtable’s Regex functions. For complex text extraction, I find those much easier to work with, though it does take some practice to know how to write the expression. For testing, I recommend a site like regex101.com (make sure to change to the “Golang” variant, which is closest to what Airtable uses for its Regex parser).
May 06, 2022 01:47 AM
Thank you @Vivid-Squid & @Justin_Barrett ! This was really helpful. It took a couple of formula fields and some automations, but here’s what it looks like:
–
Workshop: My Workshop Name
Zoom URL: https://zoom.com/s/something-here
Thanks to an automation, that field syncs from Gcal to Airtable into a record that I named Description.
Then I have a formula field named “Workshop Name” with the following code: REGEX_EXTRACT(Description,'Workshop: (.*?)<')
. The <
works because Gcal converts the line break into a <br>
and occasionally will add unnecessary html formatting that I don’t want.
Thanks to another automation, my Workshop link field (referencing the Workshop table) is updated to match the newly cleaned up Workshop Name. (Tangent: I initially had trouble with my Workshop table getting filled with garbage as I debugged this, but I used this tip and made the primary field in the Workshop table a formula so that it could not be added to if what is defined in the “Workshop Name” does not exist in the Workshop table.)
Finally, I also have a formula field “Zoom URL” with the following code: REGEX_EXTRACT(Description,'Zoom URL: <a href="(.*?)"')
. This works because Gcal converts the link into html anchor tags.
–
All-in-all, the hardest part was figuring out the right regex syntax, but that link you shared helped a lot with that. Thanks again!
May 06, 2022 01:50 AM
Since I didn’t actually need a scripting app, this doesn’t seem like the correct category anymore. For my own future reference, where should I have posted a question like this?
May 06, 2022 04:41 AM
Welcome to the Airtable community!
Thank you for posting your detailed explanation of your solution.
Don’t worry too much about it. Many people think they need scripting solutions but eventually find a non-scripting solution.
If you aren’t sure what type of solution you need, posting in the “Ask the community” is always a safe bet.