Filters for Link_row fields do not work when user_field_names is true ( List rows API endpoint)

Are you using our SaaS platform (Baserow.io) or self-hosting Baserow?

SaaS

What are the exact steps to reproduce this issue?

My setup:
I have a “jobs” table which has a field/column called “state” that links to a “states” table (abbrev, name, lat, lon). The abbrev field is the table’s primary field.

When making the following API request, ALL jobs, regardless if job meets the conditions of the filter.

url:
/api/database/rows/table/TABLE_ID/

query params:
user_field_names=true
filters: {“filter_type”:“AND”,“filters”:[{“type”:“link_row_has”,“field”:“locationST”,“value”:“STATE_ROW_ID”}],“groups”:[ ]}

The same problem happens for this filter as well:
{“filter_type”:“AND”,“filters”:[{“type”:“link_row_contains”,“field”:“locationST”,“value”:“STATE_ABBREV”}],“groups”:[ ]}

When I remove user_field_names=true, both of these work. I’m copy/pasting from the Filters Parameter Builder.

Am I doing something wrong or is this a bug?

Hey @NBO_Solutions, I’ve tried to reproduce your scenario, but for me it’s working as expected. I’ve created a table that looks like this:

If I then make an API request like:

http://localhost:8000/api/database/rows/table/742/?user_field_names=true&filters=%7B%22filter_type%22%3A%22AND%22%2C%22filters%22%3A%5B%7B%22type%22%3A%22link_row_has%22%2C%22field%22%3A%22locationST%22%2C%22value%22%3A%221%22%7D%5D%2C%22groups%22%3A%5B%5D%7D

Which is basically applying these filters:

{"filter_type":"AND","filters":[{"type":"link_row_has","field":"locationST","value":"1"}],"groups":[]}

Then my response looks like below, which is the correct response that I expected. If I set user_field_names=false then I’m correctly getting the correct error message about the field not being field, which makes because then it would expect a field ID instead of field name.