Include fields in API call


When I make an API call to list rows that include a related field I am only getting ID and Value from the related field. It would be good to be able to list the other fields too or at least be able to select which fields to include, otherwise I need to gran the ID and make N number of calls to get each row individually.

Hope this makes sense!
Thanks a lot!

Hi @yakito, welcome to the Baserow community! We’re currently working hard on the lookup field that can do exactly that! This will allow you to add an additional field to the table where you can select a link to table field in the current table and a field in the related table. It will add the related values to the table. This will prevent you from having to do additional calls to get the individual rows. We expect to release it next week.

1 Like

Thats amazing @bram ! Looking forward to test out lookup fields! (please include them in the API too!)
Let me know if there is anything I can do to help in anyway!
Have a great day!

The formula field is also going to be included in the API :slight_smile:. Baserow is API first, that means that you can do everything via the API that you can also do the web-frontend interface.

1 Like

Hi! I recently switched from hosted version to Baserow Cloud, but now when I make an API call to a table with a lookup field, I only see id and value on the results instead of all the fields of the lookup table.

I remember testing this on my hosted version of Baserow and it was working as expected.
Is there anything I should be doing to bring back the other fields when using Baserow Cloud?

Thanks in advance!
Happy holidays!

Would you mind sharing a screenshot of the structure of your table? Normally when you make an API call, the results of a “Link to table” field would look like that. With the lookup field it depends which field you’ve reference how it looks. What response did you expect?

Thank you @bram
Basically the structure I have is 2 tables, a Main table and a Logs table.
Inside the main table I have a "link to table" field which shows me the records from the logs table.

Maybe I am wrong, but what I was hoping to achieve was to get all the information from all the fields in the logs table when I make a call to the main table in order to avoid making multiple calls to the logs table.

Right now if I only get the ID for each log when I call the Main table I will need to individually make a call to the logs table to get info for each log which will translate in many queries.

It is not possible to show the other fields from the logs table in the response?

Thanks again and happy holidays!

That’s how the link to table field works unfortunately. You could use a lookup field to join the values of the related table into the table you are fetching. That way, you will be able to see the other values. In the future, we could also introduce an ID filter. That way, you can construct a single request to fetch multiple rows of the related table by creating multiple OR filters. That’s currently not available yet.

1 Like