I’m trying to filter the data from a rest API, when i click on the dropdown’s to set the fields and operators, nothing happens, it doesn’t open.
I’m using Google Chrome on a Macbook Pro.
I’m trying to filter the data from a rest API, when i click on the dropdown’s to set the fields and operators, nothing happens, it doesn’t open.
I’m using Google Chrome on a Macbook Pro.
You need to fetch the collection first. Then the values will appear. WeWeb now doesnt know what is your data structure. You should click on Continue in the step before. If you have no error in previous steps, then your API might not be returning anything.
Hi @Broberto, thanks for responding.
All previous steps were successful and all show green checkmark. I fetched the data successfully and I’m using it to display data in my web app.
It seems like there’s a bug or something that when I click on ‘Field’ or ‘Operator’ dropdown, nothing happens.
Have you checked that the API actually returns any data? If it’s not secret, drop it here with how you fetch it and I’ll tell you.
Again, the API returns data successfully and I’m using the data to be displayed, only the filter option doesn’t open for me.
You can see it there. You need to actually access one layer deeper you need to access suggestions.
Then that will work. Or you can filter it before inputting it into the div/whatever you want to bind it to.
In your case you would use [your_collection].suggestions and then [Filter].
Unless you’re able to access suggestions directly within your API call.
You might want to type in suggestions
in the result key where I wrote tickets
in the example below:
That way, you will access the list/array of items directly instead of getting the entire object from Mapbox and you’ll be able to add filters and frontend pagination on that array.
This is neat, I wouldn’t have understood that this is it’s function. Can you also access nested things like tickets.opened
?
If opened
was an object inside of tickets
, I think so yes.
But if opened
is a key inside the objects that are inside the tickets
, then no.