Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Problem with IF OR FIND formula (backslash)

Topic Labels: Formulas
548 3
cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to write a simple formula: If field X contains ‘Apples’ or ‘Cats’, or ‘Chocolate’, or ‘Dogs’, then ‘Enter in the database’.

I am not well-versed in formulas, as you will see, and am probably using a convoluted way, which is the following:

IF( OR( FIND(‘Apples’, {Field X}), FIND('Cats, {Field X}), FIND(‘Chocolate’, {Field X}), FIND(‘Dogs’, {Field X})), ‘Actionable’). The formula works for the first two values, but breaks on the last two. (Airtable also inserts backslashes there.) Can someone kindly help me figure this out?

Thanks.

3 Replies 3

What kind of field is {Field X}? It matters because certain field types are holding arrays behind the scenes, rather than strings, and the FIND() function is designed to search a string, not an array.

As a failsafe, regardless of the type of field {Field X} might be, you could try coercing {Field X} into a string by concatenating it with an empty string like this:

IF(
   OR(
      FIND('Apples', {Field X} & ''),
      FIND('Cats', {Field X} & ''),
      FIND('Chocolate', {Field X} & ''),
      FIND('Dogs', {Field X} & '')
   ),
   'Actionable'
)

Try that, and see if it gets you the result you are wanting.

Thank you. Unfortunately, that didn’t work. (The actionable only shows up for ‘Apples’. And backslashes continue appearing in the formula once posted.

Field X is a single line text field.

Are you able to post a screenshot of the formula you have and the issue you are experiencing?