Error: Insert Array into Supabase

I want to store an array into my Supabase column. Either empty [] or with a value ["asian"].

On the database side, I have this “type” setup.

CREATE TYPE ethnicity_type AS ENUM (
  'asian', 'black', 'hispanic', 'indigenous', 'middle_eastern', 
  'pacific_islander', 'white', 'multiracial', 'prefer_not_to_say'
);

create table therapists (

  ethnicity ethnicity_type[] not null default '{}',
) 

Error

Supabase Table Writer Failed!
Error inserting data: {‘code’: ‘22P02’, ‘details’: None, ‘hint’: None, ‘message’: ‘invalid input value for enum ethnicity_type: “”’}

Link to workflow

https://www.gumloop.com/pipeline?workbook_id=u3rDUELqEkv6GxFtx3LWQr&run_id=WF59tQuoM48KFgVF6moqkJ

Ask

Is it an issue on my end, or is there a way I can ensure I send arrays to the DB instead of strings?

Hey @shawnbuilds! If you’re reporting an issue with a flow or an error in a run, please include the run link and make sure it’s shareable so we can take a look.

  1. Find your run link on the history page. Format: https://www.gumloop.com/pipeline?run_id={your_run_id}&workbook_id={workbook_id}

  2. Make it shareable by clicking “Share” → ‘Anyone with the link can view’ in the top-left corner of the flow screen.
    GIF guide

  3. Provide details about the issue—more context helps us troubleshoot faster.

You can find your run history here: https://www.gumloop.com/history

Output from error shield on “ethnicity” column

[‘[“white”]’]
Note: the output turns into a list because of the output of error shield?

I added an error shield and it went through, to confirm that it’s trying to add a “string” into an List(str) column in Supabase.

screenshot

Sorry to bug you twice but would be great to get support on this too :slight_smile: @Wasay-Gumloop

Hey @shawnbuilds - Thank you for the bump!

The issue is not with the list type mismatch, you’re actually passing in a List / Array which is indicated in the input to the supabase node as its enumerated.

String or Text input/outputs are not enumerated.

The problem here is that the you’re trying to insert the value "[]" into a column that’s defined as an ethnicity_type enum. Enum types in PostgreSQL can only accept predefined values. The empty array string "[]" is not one of the allowed values for the ethnicity_type enum.

You’d have to adjust the field type to accept empty arrays.

Let me know if this makes sense and works for you.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.