Skip to main content

Advice on creating a record search component

  • April 1, 2022
  • 1 reply
  • 14 views

Forum|alt.badge.img+13

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. :slightly_smiling_face:

1 reply

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • April 1, 2022

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.