Only show the most recent record from a user

Hi,

I want to run a pipe, where I only pull the record ID from the last call from the client. So what I would do, is run a pipe on the calls table, filter on the user and sort them in descending order. In this way, I will always have the latest. However, I can’t get the pipe to work. Can someone see what I am doing wrong?

https://api.tadabase.io/api/v1/data-tables/{tableId}/records?filters[items][0][field_id]={fieldId}&filters[items][0][operator]={operator}&filters[items][0][val]={value}&order_by={order_by}

@slimpens have you tried the Tadabase Rest API prebuilt api’s Sort By One Condition or Sort By Multiple Conditions.

Yes, but this API is a combination of both a filter and a sort condition.
So, the API should do the following:

Filter the records based on a filter (e-mail)
From the results, return them in descending order.
So I need to build a combination of the pre built pipes.

@slimpens try this one i think you have to give the direction you are using ascending or descending which i added at the end with the {order} parameter and you can use asc or desc. don’t forget to add in the parameter in the parameters tab https://api.tadabase.io/api/v1/data-tables/{tableId}/records?filters[items][0][field_id]={fieldId}&filters[items][0][operator]=is&filters[items][0][val]={value}&order_by={order_by}&order={order}

@TonyM thank you, I tried the code, but for some reason Tadabase cannot filter the results. I created a test table with 2 records, with numbers 1 and 2. Either when I use asc or desc, the results are always sorted from low to high.

I also re build the pipe, but it appears that the Tadabase Rest API filter condtions don’t work. For example, i want to sort on the auto increment field. When I have 2 records, the auto increment are 1 & 2. If I run the API with : “https://api.tadabase.io/api/v1/data-tables/{{tableId}}/records?order=field_1&order_by=desc” or https://api.tadabase.io/api/v1/data-tables/{{tableId}}/records?order=field_1&order_by=asc, my assumption would be that the results of the first API would shw the table results in order of auto increment 2-1 and the results of the second api cal would be the table results of auto increment 1-2. But the API response is on both calls exactly the same.?