Query Regarding Filtering by Single-Select Value Names Instead of IDs in API Category: API & Integrations

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

SaaS

What are the exact steps to reproduce this issue?

Hello Baserow Community,

I’ve been working extensively with the Baserow API and encountered a challenge when filtering rows based on single-select fields. Currently, the single_select_equal filter requires the use of option IDs instead of their value names. This creates a significant issue for workflows where single-select option IDs are frequently updated or changed.

Is there a way to filter rows directly by the single-select value names instead of their IDs? If not, are there plans to support this functionality in future updates? * It would eliminate the need for additional API calls or caching mechanisms to manage changing IDs.

To reproduce the issue, create a single-select field, populate rows with its values, then attempt to filter rows via the API using value names instead of IDs, which will fail because the API requires IDs for filtering.

Hi @gjk,

I did some tests on my side and was able to succesfully filter a single select field by the value of an option instead of the ID. Here’s an example:

My example data:

My request:
https://api.baserow.io/api/database/rows/table/{{tableid}}/?user_field_names=true&filters={"filter_type":"AND","filters":[{"field":"Project Manager","type":"contains","value":"Sarah Johnson"}]}

The response:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "order": "1.00000000000000000000",
            "Project Name": "Website Redesign",
            "Description": "Complete overhaul of the company website with new branding and improved UX",
            "Start Date": "2025-04-01",
            "End Date": "2025-05-15",
            "Project Manager": {
                "id": 3040950,
                "value": "Sarah Johnson",
                "color": "darker-purple"
            },
            "Status": {
                "id": 3040510,
                "value": "In Progress",
                "color": "darker-green"
            },
            "Total Story Points": "120",
            "Team Members": [
                {
                    "id": 3040519,
                    "value": "Maria Garcia",
                    "color": "dark-brown"
                },
                {
                    "id": 3040521,
                    "value": "Alex Wong",
                    "color": "darker-brown"
                },
                {
                    "id": 3040528,
                    "value": "David Kim",
                    "color": "dark-blue"
                }
            ],
            "Sprints": [
                {
                    "id": 1,
                    "value": "Website Redesign Sprint 1",
                    "order": "1.00000000000000000000"
                }
            ],
            "Remaining Story Points": "15",
            "Last modified": "2025-04-07"
        }
    ]
}

Thanks for your reply, @cwinhall. I actually tried using the same filter query before and encountered an issue. When you have values like Sarah Johnson and Sarah Johnson Etc, it returns two records. However, I only need the exact match for Sarah Johnson, which should return just one result.

Hi @frederikdc again, Can you please take a look at my query here !!

The single_select_equal filter indeed requires the id of the single select item. There are no plans to change this in the near future.

I see 2 potential work arounds of this:

  • Replace the single select field with a link to table field and store the project managers in a separate table. This allows you to work with the link_row_has filter. This will still require an id, but since the project managers are stored in a separate table, it might be less likely that the id’s change over time.
  • Add a formula field to your table with the formula totext(field('Project Manager')). This converts the single select value to a single text value and allows you to use the equal filter that checks for an exact text. This allows you to distinct the value Sarah Johnson from Sarah Jonson Etc.

I guess that the second workaround is the most likely solution for you. You can hide the formula field from the end user and it automatically updates when you update the single select field.