1

I'm using pyairtable to fetch data from an Airtable with Python.

Both #1 and #2 work fine. I'm looking for a solution to combine the two formulas. I need one formula that would give the results matching column1 = string1 and column2 not empty.

from pyairtable import Table
from pyairtable.formulas import match
table = Table(API_KEY, BASE_ID, TABLE_ID)

#1
formula = match({"column1": "string1"})
results = table.all(formula=formula, fields=['field1'])

#2
formula = "NOT({column2}='')"
results = table.all(formula=formula, fields=['field1'])
gtalarico
  • 4,409
  • 1
  • 20
  • 42
Zumplo
  • 150
  • 1
  • 9

1 Answers1

0

There is no NOT() in pyairtable but should be very easy to do with just plain text using Airtable Formulas AND and NOT

formula = "AND({column1}='John',NOT({column2}=''))"
table.all(formula=formula, fields=['field1'])

Formula Example Table Example

gtalarico
  • 4,409
  • 1
  • 20
  • 42