Google Calendar Sync generates HTML in the "Description" field

Topic Labels: Sync
872 1
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

This is driving me nuts: I’m importing events from a Google Calendar sync and it generates HTML markup from the event’s “description” field. I can’t for the life of me figure out a reasonable way to get rid of the HTML. HELP. This seems like it should be easy, but short of some kind of laborious Zapier recipe, I can’t figure it out.

Screen Shot 2021-09-07 at 11.59.00 AM

1 Reply 1

Welcome to the community, @Madara_Mason! :grinning_face_with_big_eyes: I recommend making a formula field and using this to create a clean version of the data:

TRIM(REGEX_REPLACE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Description, "&amp;", "&"), "&nbsp;", ""), "</p>", "\n\n"), "<br>", "\n"), "<[^>]*>", ""))

That formula directly replaces certain tags with equivalent symbols (newlines, ampersands, etc.), and then REGEX_REPLACE() bulk-replaces any other HTML tags with nothing, followed by a final trim to clean up things like that second example where it starts with line breaks (which are newlines by that point).

If you don’t want the line breaks at all in the final output, then use this slightly shorter version:

TRIM(REGEX_REPLACE(SUBSTITUTE(SUBSTITUTE(Description, "&amp;", "&"), "&nbsp;", ""), "<[^>]*>", ""))

I kinda-sorta recreated your samples to make sure this would work correctly. {Cleaned} is the longer formula output, {Cleaned copy} is the shorter one.

Screen Shot 2021-09-07 at 9.15.25 PM