Query parameter Syntax for filtering collections from API

Hi everybody,

I have read most of the threads concerning collections from API and I can’t find the answer.

I made my own API which has a way to specify a parameter named “episodename”
Below a screenshot from postman giving the result (1 item) that I expect in Adalo.

In Adalo I tried to pass this parameter within the query parameter :
image

But it doesnt work. In Adalo, it displays the list of all the items. As if my query was not taken into account.

Any idea what I’m doing wrong ?

In that example, the Name of the query parameter should be set to “episodename” and the Value should be set to “Friendss05e13”

Hi Ben
Thank you for your quick answer I appreciate.
Nope it doesnt work either.

Here is my database reached through my api
image

Here is the query in adalo :
image

I still have all the items returned in the list :
image

If you look at the url in the screenshot from postman above, my url specifies a route : “wordsperepisode?”. where should I put it in Adalo ?

Hi Felix,

You have to put the value between “” so instead of Friendss05e13 it must be “Friendss05e13”.

Have a go and let us know.

Francisco

Hi Fransisco
Thank you for your answer.
Nope it doesnt work.

I also tried with a simplified version of my API (where Adalo just have to past the value after the url)
image

But still it keeps returning me the list of all items.
By the way I am surprised it does since I would expect to bug/return an error message in case the url is not correct. Or an empty list. Did Adalo made that in case of error the whole list is returned?

I tried this :
image

and that (with nothing for the name)
image

Try value

episodename=‘Friendss05e13’

even though I see the column name is episode so try

episode=‘Friendss05e13’

I tried the following and none works

image
image

Fransisco, did you yourself succeed doing it ?
I guess there is a single syntax but I can’t find any real example I could copy. (and nothing in the documentation)

@Ben Maybe you could give us an hint on how the url is concatenated so I can adapt the Name and the value accordingly ?

@FelixWat the issue is that your base URL doesn’t include everything you have in your screenshot.

Currently, you have your external collection’s base url set to:
https://pxapi20200331153446.azurewebsites.net/v1/word

So, when you add a query param filter to your list, it will make the call to this URL:
https://pxapi20200331153446.azurewebsites.net/v1/word?episodename=Friendss05e13

However, your original screenshot shows that you’re trying to request this URL:https://pxapi20200331153446.azurewebsites.net/v1/word/wordsperepisode?episodename=Friendss05e13

Hi @Ben
Thank you for your prompt answer again.

Ok I changed my api so it now works ! :slight_smile:
So as a recap for some users having this question in the future, Adalo is doing : URL+"?"+{Query Parameter Name}+{Query Parameter Value}

2 Likes

How exactly would you insert this in the query parameters filters sidebar?

A screenshot would be helpful.

Hi guys @Ben, @FelixWat, @anon78309838 , I’m having this same issue and i need an urgent help here as the above solution did not solve my own issue. my base URL is https://folomebet.herokuapp.com/api/publicBet/matchbets which return all bets and https://folomebet.herokuapp.com/api/publicBet/matchbets?eventcode=1001 should return just bets with 1001. it works fine on browser but when i run as filter for list with base url: https://folomebet.herokuapp.com/api/publicBet/matchbets and filter name= eventcode and value = 1001 it still returns all bets… i have tried for days now searching for solutions but non has solved it.

2 Likes

Can you please show how you ended up doing everything with screenshots?

can we get a tutorial on how this works with sheetdb?

Hi, have you solved your task? I need to filter the collection based on email = loggedin user’s email. Could you help?

I have not, I apologize that I do not have a better update

I think this video explains it well Adalo & Xano: How to Use Adalo Query Parameters to Filter a List on a Screen - YouTube