Hello,
I try to run Supabase Database | Select action in workflow and generally is ok. But how to filter by empty column like it is in collection?
Here is Database | Select in workflow and i cant find filter if its empty. I tried to to change different conditions and for value to write manually, empty, EMPTY, “empty“, “EMPTY“, null, NULL, “null“, “NULL”, just ““, leave nothing… but always return error.
From other side, in Collection have filtering by “Is empty“. I need to change filter dynamically so it become problem. Also Database | Select action dont have Sort By which exist in collections.

Why dont have option me to write some SELECT query in Database | Select action?
Hope somebody will help. Thank you in advance.
I have even tried to make postgress function with arguments but when i call the function from weweb it gives me error:
message: “invalid input syntax for type uuid: “””
I have try with empty value for argument in workflow action or with null. Its always same.
How to send real: Is empty, null etc. from Weweb?
I solve it. This is DB Postgres Function if somebody need something like this:
CREATE OR REPLACE FUNCTION public.get_categories(
p_parent_id text,
p_sort text DEFAULT ‘ASC’
)
RETURNS SETOF public.categories
LANGUAGE sql
SET search_path = public
AS $$
SELECT *
FROM public.categories
WHERE (
– if frontend sends empty → treat as root category
(NULLIF(p_parent_id, ‘’) IS NULL AND parent_id IS NULL)
OR
– valid UUID comparison
(NULLIF(p_parent_id, ‘’) IS NOT NULL AND parent_id = (NULLIF(p_parent_id, ‘’)::uuid))
)
ORDER BY
CASE WHEN UPPER(p_sort) = ‘DESC’ THEN position END DESC,
CASE WHEN UPPER(p_sort) = ‘ASC’ THEN position END ASC;
$$;
WeWeb:
Hey @Zoran.Velinov 
Thanks a lot for coming back to share your function and full setup, this is super helpful for anyone hitting the same limitation with Database | Select and NULL filters.
The collection approach you mentioned is definitely handy when things are less dynamic, but for your use case with the nested categories and runtime parent_id , your Postgres function + RPC solution looks like a very solid and scalable way to handle both the NULL logic and sorting.
1 Like