Hey there! I need to create a component for one of my apps that searches through my records by a couple of criteria corresponding to fields. Is there a better way to do it than just looping thru every record and checking? I have thousands of records. How does the Airtable search app do it for example?
Or perhaps someone has already built something open source that I can use?
Ideally I’d be able to use something built into Airtable like Interfaces, but they are not quite customizable enough yet.
Page 1 / 1
Having your code loop through every record and filter for the ones you want is one technique. Here are some others.
- Limit the records you are searching for by querying a filtered view instead of the table
- If you only want records linked to a particular parent record, get those record IDs from the parent record, and retrieve only those records
- If you will need to search the list of records multiple times for slightly different values, consider building a hash map. This technique has been described by Bill French multiple times in these forums and he has some excellent posts on the topic.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.