# Weweb - Supabase linked ID's

**URL:** <https://community.weweb.io/t/weweb-supabase-linked-ids/9135>\
**Category:** How do I?\
**Tags:** binding, authentication, supabase\
**Created:** [June 15, 2024, 12:51pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135 "2024-06-15T12:51:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![radume](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/radume/32/9698_2.png) [@radume](https://community.weweb.io/u/radume)\
**Post date:** [June 15, 2024, 12:51pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/1 "2024-06-15T12:51:02Z")

</div>

Hello everyone, I have created a “Users” table in Supabase public schema that I can use alongside the users table in “auth” schema, in order to capture more information (first name, last name). I have linked the user id from the auth schema to the user id from the new table that I made and I created a workflow on register to add the additional information (first name, last name) into the new users table.  
The problem is that even though both ID types are UUID, the workflow keeps crashing and in Supabase I get this message, saying that the column types don’t match, even though they are both UUID. I don’t know what to do here.

![34242](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0b50c3dddfbc70e0ba88f18bed2f6be97228e4a1.png)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 15, 2024, 2:12pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/2 "2024-06-15T14:12:52Z")

</div>

Hello, without the context of your setup, e.g. your table’s definitions it’s really tough to say what’s going on, it seems like the two data types don’t match for some reason. The schema/definition of your table users, and the error logs would be nice.

Also, I think the issue might be that the table name is Capitalized? I see this quite often with people around here.

By the way, if you don’t want to deal with this, I made a two step setup which also includes a trigger and the users table and much much more, including roles setup for WeWeb - which tends to be an another tough spot and also the RLS setup utilities.

> [@\[Supabase\] Role Based Access in two steps](https://community.weweb.io/t/supabase-role-based-access-in-two-steps/9089/2):
>
> Amazing @Broberto!! Its true time-saver, have to have it on my new job board project smiley See you at the integration ;D

---

<div class="post-metadata">

**Author:** ![radume](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/radume/32/9698_2.png) [@radume](https://community.weweb.io/u/radume)\
**Post date:** [June 17, 2024, 6:14pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/3 "2024-06-17T18:14:08Z")

</div>

![32423423](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e764c2f029686464a2b7536b8506a2aefb591fac.png)  
Thank you, I’ll check it out, 2 step setup would work as well. In case anyone else will have this issue, I think I made it work. The default value was left blank. I chose the auth.uid option and it seems to work now.

---

<div class="post-metadata">

**Author:** ![radume](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/radume/32/9698_2.png) [@radume](https://community.weweb.io/u/radume)\
**Post date:** [June 19, 2024, 12:36pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/4 "2024-06-19T12:36:15Z")

</div>

It seems I spoke too soon. It worked for a bit and now it broke again. Is this a bug? I am trying to find other cases but I can’t find anything online. This is the error I get in Supabase log

```auto
{
  "error_severity": "ERROR",
  "event_message": "null value in column \"id\" of relation \"users\" violates not-null constraint",
  "id": "ec29d199-5375-4b48-bb37-b4864ff7d235",
  "identifier": "syzhvqsutabahkoiydbf",
  "timestamp": 1718798109301000
}

```

From what I can see, something is preventing the user ID from the auth schema to get copied to the users table that I made, in the public schema. But I don’t know why. The only info dialogue that I get is that one saying that the user id types are not the same, even though they are both UUID’s

---

<div class="post-metadata">

**Author:** ![radume](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/radume/32/9698_2.png) [@radume](https://community.weweb.io/u/radume)\
**Post date:** [June 19, 2024, 1:08pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/5 "2024-06-19T13:08:25Z")

</div>

And in Weweb this is how the flow looks like. Again from what I can see, The first step of the workflow is executed correctly (the sign up), it generates the user ID, but when it gets to step 2 (to insert in the new table the additional information) the ID appears to be undefined.

 ![4r52234](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e94b6787a44b52c03176e541000b121c74cac8e0.png)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 19, 2024, 1:08pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/6 "2024-06-19T13:08:56Z")

</div>

> [@Broberto](#):
>
> Hello, without the context of your setup, e.g. your table’s definitions it’s really tough to say what’s going on, it seems like the two data types don’t match for some reason.

Hello, unless you provide some details about the whole setup, it’s almost impossible to help, as it would be pure guessing. I’d either have to have a look at your Supabase Setup here, [or on a call if you feel more comfortable with it.](https://cal.com/broberto/no-code)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [June 19, 2024, 1:10pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/7 "2024-06-19T13:10:22Z")

</div>

You need to Sign In (with your preferred method, e.g. password and email) after signing up an user. Sign Up doesn’t automatically log-in your user (or does it?).

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [June 19, 2024, 1:18pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/8 "2024-06-19T13:18:30Z")

</div>

You can either try to setup a trigger in your database so it create the row automatically on signup, or do it in WeWeb after the first login by checking the row doesn’t exist

---

<div class="post-metadata">

**Author:** ![radume](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/radume/32/9698_2.png) [@radume](https://community.weweb.io/u/radume)\
**Post date:** [June 19, 2024, 2:38pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/9 "2024-06-19T14:38:44Z")

</div>

Thanks Roberto, that seemed to be the issue indeed. It kept getting undefined user id because the user was not signed in. I removed the email confirmation condition and added a sign in step in the workflow between the sign up and database insert and it works. The strange part is that yesterday it worked. I don’t know what I did, but it worked without the signinng in step. Anyway, thank you for the answers, it helped a lot.

---

<div class="post-metadata">

**Author:** ![radume](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/radume/32/9698_2.png) [@radume](https://community.weweb.io/u/radume)\
**Post date:** [June 19, 2024, 2:42pm UTC](https://community.weweb.io/t/weweb-supabase-linked-ids/9135/10 "2024-06-19T14:42:41Z")

</div>

Yes,I think I will split the flow in 2, on register I will ask for email and password, then after the user confirms the email and logs in, I will prompt them with a “complete your profile information” screen where I will ask for the first / last name and that is when I will do the database insert into the users table.
