Help

Re: Filtering

432 0
cancel
Showing results for 
Search instead for 
Did you mean: 
rmxburhan
4 - Data Explorer
4 - Data Explorer

HI i want to ask some questions i have a two table Product and Category, in product i have linked to another record field with the name 'Categories' and i want to filter the record in Product table with id that i have in Category table i have tried this but it's always return empty records. 
https://api.airtable.com/v0/<basedid>/<tableid>?filterByFormula={Categories}='recVXBZfPO530BgxK'
Do you have any solutions?

3 Replies 3

Hmm, if you want to filter by the record ID, I think you're going to need to create a lookup field that displays the linked Category record's record ID in the Product table.  You might also be facing some issues due to URL encoding, and you can read more about that here: https://support.airtable.com/docs/airtable-web-api-using-filterbyformula-or-sort-parameters#url-enco...

Hello @rmxburhan,
Instead of using 

filterByFormula={Categories}='recVXBZfPO530BgxK'

Try this 

filterByFormula=AND({Categories}='categoryID or name')

Keep in mind that when you search record using API⇒filterByFormula you can direct put linked record value.
But,
If you need to specify and search for only recId then first you need to lookup category recId to product table fields.
On that case formula like 

filterByFormula=AND({categoryRecId}='rec******')

When you're not sure about a specific field and need to use multiple fields something like SQL LIKE Query.
You can also use OR if you need any match instead of the AND(for all matches) function.
Check this full post https://community.airtable.com/t5/development-apis/api-amp-voiceflow-invalid-request-unknown/m-p/181...

👍

SabtainSaleem
4 - Data Explorer
4 - Data Explorer

It looks like your formula might be missing some key syntax. Try using the FIND function to match the record ID within the {Categories} field.