Hi, ive got a problem with my collection who must be an array(im new to this lol) and the lookup formula which doesnt work bcs of this

Hi everyone im new to weweb and supabase and I got an issue I can’t seem to solve alone.

Ok so first of all lets talk about what im creating to understand my problem better. I am currently working on a projet of reading web app, the goal is for user to freely upload their online stories and readers to directly read it basically. Im in the process of creating an author dashboard for author to directly publish their book/ upload data in supabase and retrieve it after to show the book.

I did my form container and input for the author to create his own book.

Now lets get to my problem and thanks to all if you are still reading this and willing to help me.
I have two table currently, one for user and one for book, in the one for user we get the username and other stuffs, in the other one the book table we got all the infos about the current book, each table as a column that is the auth id, so when someone signup automatically in the user database we have the auth id, same for ebook, this way i can retrieve book by user.

Now in my data table ebook I have a username column, and I want to take the username from my user table, for that when I insert the data in the table with the form Im using a lookup formula to search in the database user the username corresponding at the auth, which I take from current auth connected

And now the issue is there, paramether must be an array, after carrefully checking everything I found out that my collection in weweb referring at the table in supabase is bugged, it worked fine at first, but when adding column suddenly my table is not an array.

It became like this, so I was confused and im new to this (was working with bubble)
So what happened there ? I did some things : I recreated my table, at first it worked then when adding all column it didnt anymore, by deleting one column after the other it still doesnt work.

Now my user table is working, I mean the collection is there running apparently it is an array, so I did what seemed to be the solution, I copied the suer table and just edited the column to match my book table, but then it still became something other than an array.

So im kind of lost to what to do, if someone could help me I appreciate it. Also am i doing the right thing by using a lookup formula ?

And while were at it, how can I make private my dashboard so only current auth can use it ? is there a video on this ? I was thinking of using special url in the page that is the current auth, and a workflow on page load if user is not auth then redirect.

If you are still reading this and willing to help thanks a lot because im realllllly stuck.

image
lookup formula

user databse :
image

book database i did 5 times differently :

it became something else than an array

First of all, don’t use special characters in your table names. You’re supposed to use snake_case. I have a pretty big feeling that that’s the issue in this case, as it messes up with Supabase Plugin and it doesn’t fetch the data, as the table name is wrong. The rest seems to be okie dokie. Also make sure you have your table filled with data.

Many no-coders who might find this difficult, as you right now, actually find useful the 1:1 sessions that I do where we discuss anything that troubles them regarding WeWeb, Supabase, SaaS in general :slight_smile:

Hi thanks for your quick reply I appreciate it ! I did that and I still have the collection must be an array, but now I must have moved something bcs my user table too isnt an array, the only thing I did is move the primary key, I set it to the auth which is equal to current auth, can it be the issue ?

Have you tried re-fetching the data (collection) after refreshing the table?

yes i did but ill try to move the primary key to something that isnt the auth just to see if it is the problem

If you get this error, most likely it means there is a misconfiguration in your Supabase setup e.g wrong table name, or something else. This error usually appears when Supabase returns an error instead of the data. You can also check out what’s going on in the network tab :slight_smile:

thanks i’ll do that, but the thing is even if it say collection must be an array I can still access the collection in weweb with all the table data that is really weird. I changed the auth and the primary key for my user table and it became an array again apprently it may be the issue

welp still do not work when changing this

:)) You still have the Novel/fanfic table name, which is w r o n g

Screenshot 2024-06-27 at 15.36.19

yesss you were right on this I think it was from the column the prob, so yes i edited the name, and then I needed the reassign every constraint in the column bcs they were still the last name. Thanks Broberto I wont make the mistake again lol.

1 Like