REST API - Is it possible to get more detail from linked row?

Hello there. I was working on my sales management project which accessed multiple rows from another table in the base. when I used REST API, I found that I could only get the key of the row, instead of all the fields the row contained.

I have an ‘Inventory’ and ‘Order’ table in my base. the Inventory table has ‘Item Name’ and ‘Price’ fields, I access them from the Order table through a Link to table field called ‘Sales’, to show what items have been purchased in the very order.

It looks all good in Baserow, yet when I access it from API it seems only the key is obtainable:

"Sales": [
        {
            "id": 1,
            "value": "Apple"
        },
        {
            "id": 2,
            "value": "Banana"
        }
    ]

I was wondering if it’s possible to get more information out of linked rows? in this case, I would like to have ‘Price’ field along with it, as the following:

"Sales": [
       {
           "id": 1,
           "value": {
               "Item Name": "Apple",
               "Price": 300
           }
       },
       {
           "id": 2,
           "value": {
               "Item Name": "Banana",
               "Price": 500,
           }
       }
   ]

Thank you folks.

1 Like

Hi @Arrow, this is currently only possible by making an additional get row request to the related table, or by adding a lookup field to the table. The lookup field will expose another field value is the related table.

Because more users are asking to do this, I’ve created this issue on the backlog to make it easier via the API: Join additional fields of a relationship via the API without creating a lookup field (#2460) · Issues · Baserow / baserow · GitLab.

1 Like

Hello @bram, I’ll be looking forward to the future update, Thank you for the reply!

The groundwork for this request looks mostly complete in the issue you linked @bram - but I don’t think we’re able to use that join when getting a row with get_database_table_row. Please correct me if I’m wrong.

I commented in the GitLab issue but wanted to throw my hat in the ring here too. This would be awesome to have and would solve a lot of headaches for my team.

Hey @qcasey, the join query parameters are only available in the Baserow API spec endpoint.