foolish-indigoF
Refine2y ago
33 replies
foolish-indigo

Table filtering where data column is an array of strings.

I have a form that allows users to select multiple values to be used as tags. The column is called industry and is set as a text[] datatype in Supabase. Data entry for the user works as expected and displays correctly.

I'm having an issue when attempting to apply a filter.

<Table.Column
dataIndex={['industry']}
title='Industries'
width={205}
render={(value) => {
  return (
    <Flex wrap gap='4px'>
      {value.map((industry: string) => {
        return (
          <Tag key={industry}>
            <Space>{industry}</Space>
          </Tag>
        );
      })}
    </Flex>
  );
}}
filterDropdown={(props) => (
  <FilterDropdown {...props}>
    <Select
      options={IndustryOptions.map((industry) => ({
        value: industry.value,
        label: industry.label,
      }))}
      placeholder='Filter by transaction industry'
      style={{ minWidth: 200 }}
      mode='multiple'
    />
  </FilterDropdown>
)}
/>


I get the following error when selecting a value to filter by, with the same result whether it's 1 value or more.

@refinedev_supabase.js?v=4f35141b:3667 
GET https://XXXXXXXXXX.supabase.co/rest/v1/engagements?select=*&offset=0&limit=50&order=engagement_date.desc&industry=in.%28Aerospace%2CAutomotive%29 400 (Bad Request)
{
    "code": "42704",
    "details": null,
    "hint": null,
    "message": "could not find array type for data type industry[]",
    "statusCode": 42704
}
Was this page helpful?