Filter (text search bar) data from custom database

Hello guys,

Does anyone please know if/how you can filter the list based on the search bar? Since the collection is from an external collection (Airtable), it’s different than when it comes to internal database :thinking: Thanks for the advice!

Hi @Tommen,
You need to apply a “filterByFormula” and set your filter.

the {} is to guarantee that if you are using fields with spaces e.g. “ID USER” it filters properly.
Also if I recall correctly, the field to match in Airtable should be the 1st column of the airtable table, That is how Airtable considers the primary key of the table besides the internal ID of the row.

I never tested in “real time searches” if that what you use with Search Bar, curious to see how that works out.

image

1 Like

Hello @JL_LJ ,
Thank you for your response!

Can I please ask you if this formula is correct? I am trying to search for the name of a property called “Name”. Also, it is listed in the first column in Airtable but still cannot make it work :thinking:

Hi Tommen,
where does “Tip Fields > name” come from? Is it an ADALO select/input?

Your {name} is the airtable primary key

1 Like

Tip Fields > name comes from an external collection that is in Airtable :slight_smile: The field that is meant to sort the results is the search input field (hope this answers the question :smiley: :slight_smile: ) Sorry to ask, but does the aritable primary key refer to the first airtable column? (the name of it) Thanks for your help :slight_smile:

You are doing the other way around then:

{name} this is the airtable field that you want to compare

While the “Tips fields > name” should be the input/select value from Adalo that you want to insert to compare.

In my printscreen, the “input7” is the select field on the right while Id is the airtable
image

Yes, the first column is a sort of Primary key that airtable and Adalo use together to make searches.

1 Like

Let me please ask you one more question. Does the process differ if I am not using a select field but Text Field that sorts out the list below?

Hey @Tommen ,
Select field or Input text field, should not make difference. Let me know how it goes, if you can’t do it, I will make a Cloneable app and airtable base tomorrow. Cheers.

1 Like

Hello @JL_LJ,

If you could please do that I would be grateful. I tried to play with that to make it work but for some reason I must be doing something wrong :confused:

Hi @Tommen ,
Here you go,

In the beginning you see 2 fields used:
1 for input where I use the “=” in Airtable, that will only look for exact Strings

So using “John Doe” you cannot write “John” and expect results, then I do same with select, in this case since you select the filter will work flawless.

As a hack/workaround, I used the FIND formula, that will allow you to use a sort of “Contain”, which means, if you search for “John”, then “John Doe” will actually appear.

E.g. “FIND({name},‘your input field here’)”

You have here a quick video:

2 Likes

Hey @JL_LJ ,

You are legend! I finally made it work, thank you so much. And the find workaround is great! :slight_smile: :slight_smile:

1 Like

Hi Tommen,
A correction from my part, it seems that you can already filter using “filterByFormula” with also other fields that are non-Primary keys.

1 Like

Hello,

Thank you for an update, I will give it a try! :slight_smile:

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