Help

How do you FIND() or REGEX_MATCH() in a RTF Long text field?

Topic Labels: Formulas
Solved
Jump to Solution
1141 2
cancel
Showing results for 
Search instead for 
Did you mean: 
momentsgoneby80
7 - App Architect
7 - App Architect

Hi!
I’ ve encountered a possible Airtable quirk and was wondering if anyone has a hint how to work around it.

I have a Long Text Field with RTF enabled. In this field I have RTF formated text / Markdown text.
In a formula field I’m trying to search this field for Blood Type: AB and if found output AB. Nothing strange so far. Only issue is that no such instance is found and the cell remains empty.

find
I have tried

IF(
	FIND('Blood Type: AB',{Profile}),	
	'AB'
)

and

IF(
	REGEX_MATCH({Profile}, 'Blood Type: AB'),	
	'AB'
)

As I figure that it’s the markdown messing with it I have also tested

IF(
	FIND('**Blood Type:** AB',{Profile}),	
	'AB'
)

and

IF(
	REGEX_MATCH({Profile}, '**Blood Type:** AB'),	
	'AB'
)

and

IF(
	FIND('__Blood Type:__ AB',{Profile}),	
	'AB'
)

and

IF(
	REGEX_MATCH({Profile}, '__Blood Type:__ AB'),	
	'AB'
)

I even tested adding a &'' at the end of the field name, just in wild fishing/testing effort. No luck.

Does anyone know how to do this? If I change the text to ‘normal’, non markdowned text, it all works as expected. But then, what’s the point of having RTF enabled and using markdown if some formulae become brittle when used?
Is it actually true that you can’t find or match markdowned text or is it just my brain that is in full vacation mode?

1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

Hmm, check this out

I wasn’t able to add the Korean characters in though. Perhaps those’re what’s causing the FIND() to error out?

Screenshot 2022-07-21 at 6.05.04 PM

And the formula is

IF(
  FIND(
    "Blood Type: AB",
    Profile
  ),
  "AB"
)

See Solution in Thread

2 Replies 2
TheTimeSavingCo
18 - Pluto
18 - Pluto

Hmm, check this out

I wasn’t able to add the Korean characters in though. Perhaps those’re what’s causing the FIND() to error out?

Screenshot 2022-07-21 at 6.05.04 PM

And the formula is

IF(
  FIND(
    "Blood Type: AB",
    Profile
  ),
  "AB"
)

Hi @Adam_TheTimeSavingCo!
Nope, not the Korean messing it up. I copied your base and added the Korean and it works just fine. But in my base it just doesn’t. If I copy straight from my base to yours, yours doesn’t work for that new record either. There’s something with the markdown going on. A simple find is easy stuff. Not this though.

I created a new formula field to pull in the {Profile} info so I could see the exact markdown, nothing more and it outputs this

"Profile
- Name: Baek Seung
- Hangul: 백승
- Birth Name: Kim Hyun-Woo (김현우)
- Born: October 5, 2004
- Birthplace: South Korea
- Height: 186 cm
- Blood Type: AB
"

If I simply type what’s on the last line it doesn’t work. I have tried this multiple times before asking here. With and without the -.
If I copy the last line, with the inititial - and paste it in either your or my opening formula it suddenly works. I can’t explain why, but suddenly it works.

I’ll mark your answer as a solution as that is the answer that will help most that check this topic. I guess my base just wants to feel special. :grinning_face_with_big_eyes: Thank you so much for having a look and taking the time.

Sidenote for those eagle eyed: I screenshot before renaming the field {Profile}, so though the image mentions another field, my formula never did. That was not the problem.