I have been running around in circles and not sure what I am doing wrong. I need to use the API calls from Make.com to Baserow to return a filtered set of rows where there are more than one element to filter on. The instructions on using the API calls from Make stop before showing the last step of how to format the query. I have other calls in the same flow using the List Rows module that work fine, so I know the connection is all good and the data is passing through, just not sure how to format the API call so it works. Can anyone see what I am doing wrong? (The json comes direct from baserow.io/api-docs’s handy “Open filters parameter builder”. I tried the json format and the query format, no luck.
I get this error in Make with the json query format.
Can you try to uncheck the Map checkbox so you can offer a key/value pair to the querystring? You now should be able to set the key to filters and offer the JSON part as the value.
Thanks Frederik, really appreciate your assistance and I am enjoying working with Baserow so far. If I can just work out the query string I will be able to really have some fun. So I tried your suggestion but unfortunately that returns an UnknownError [400] [Collection].
I did find I had the URL wrong initially, but fixed that and can call the API without the query string ok, but just can’t get the query string formatted correctly. Corrected screenshot with your suggestion.
It is possible that the blocks from Make are not updated yet to work with the filters parameter since this was recently added to Baserow. You can also try to use the URL encoded query parameters instead of the JSON. This replaces all curly braces and other characters with a URL encoded variant.
In case this does not solve your problem, you still have 2 alternatives Replace the querystring with the following:
key: filter__Status__single_select_equal
value: 1322870 (or whatever value you want)
Using a HTTP Make a request building block
This makes a request to the Baserow API using a standard HTTP building block. The consequence is that you need to do the authentication yourself:
I am making progress. I can now get the API query to work with the following format, with one final hurdle… how can I reach into the array to get the value? If I pass a string to search a field that is a string, all good, but if its an array (eg. Select list) I’m not sure how to format that. This is what currently works.
But this doesn’t…
But changing to __contains does work.
But not if passing the Integer for this pick list item, which is a little dangerous if you change the text of the option, it will break the process. If anyone know how to filter on the ID instead of the text for the item that would be great.
So… its working, a little clunky, but… its working. I will document any other findings here for anyone else struggling with query strings in Make.
There are several filter that you can apply to an element. Open the API documentation of your database and click on the item Filters on the left side to get an overview:
So, you can use equal or not_equal for text input. But for a single select field you need to use single_select_equal. For a linked field, you use link_row_has.
Ah, so that is how those work! Wonderful. Yes, its a single select field and I tried that and it worked perfectly. Thank you so much, really appreciate the help!
For those following along the query now looks like this in Make.
I should have not spoken so quickly. This approach has created another issue, there is a difference between how the List Rows module and the API call of List Rows returns the data. Here is the issue:
List Rows returns one bundle per row (the collection = the row in this case), which you can then pass into other functions such as text or integer aggregators.
List Rows via the API call returns a single bundle that includes the array of collections (rows) but buried down inside the body/results tag.
The issue is modules such as the aggregators don’t know how to handle this. “results” only returns the last row read. While is says there is a count of 4, only the last row is accessible in MAKE.
I suspect this is more a MAKE issue in how its unwrapping the API call maybe, but at this point I can’t find a solution to get down to the collections. So, stuck again.
Normally, you should be able to use the Iterator block and set the results array as the input of the block. The output should be the bundels of the result are that are splitted.
Magic, that works! Thanks so much for unraveling that mystery.
Just to show the flow in this example where I use the API call to get the filtered set of rows (two filters in this case), then use the Iterator to extract to collections, then sum up one field from the Payments table, then pass to the orders table to sum up the total orders, then fetch the members details and write out all the elements to a Remittance table.
You can create all the filters in a separate view in baserow and refer to that view in Make using the view_id parameter in the querystring. This will automatically apply all the filters and sorts from the view.
Thanks for you suggestion, but I am trying to fetch the rows in javascript fetch, and I am trying to build the query but not getting any solutions or resources.