Compare a linked field with a lookup field

I’ve a linked field that I want to compare to a lookup field. If any of the linked records in the linked field appears in the Lookup field I want to generate an error of some kind.

Linked field: Wishlist (Internal) (link to toy table)
Lookup field: Toys (lookup toy table)
Formula that I used: IF(FIND({Wishlist (Internal)},{Toys})<2, “:white_check_mark:Wishlist updated​:white_check_mark:”, “:stop_sign:Wishlist has given toys​:stop_sign:”)

It works if there’s only 1 linked record in the “Wishlist (Internal)” But it doesn’t work for multiple records. Is there any other way to do this?

Not natively in Airtable’s formula field. It currently lacks the ability to iterate through a collection (e.g. multiple linked records) and perform some operation on each item in that collection (e.g. look for that same item in a collection in another field). To do this, you would need to either write custom code that accesses the data via Airtable’s REST API, or use a script in the scripting block. In either case, you’ll be using a scripting/programming language with far more robust capabilities for dealing with arrays (collections of items). Let us know which way you wish to go, and we’ll do our best to help.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.