# Supabase Update action : "TypeError: Cannot read properties of undefined (reading 'id')"

**URL:** <https://community.weweb.io/t/supabase-update-action-typeerror-cannot-read-properties-of-undefined-reading-id/6249>\
**Category:** Ask us anything\
**Tags:** supabase\
**Created:** [January 7, 2024, 2:46pm UTC](https://community.weweb.io/t/supabase-update-action-typeerror-cannot-read-properties-of-undefined-reading-id/6249 "2024-01-07T14:46:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LivingStoneHgS](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LivingStoneHgS](https://community.weweb.io/u/LivingStoneHgS)\
**Post date:** [January 7, 2024, 2:46pm UTC](https://community.weweb.io/t/supabase-update-action-typeerror-cannot-read-properties-of-undefined-reading-id/6249/1 "2024-01-07T14:46:19Z")

</div>

I’m strangely stuck in my dev because of the UPDATE (and UPSERT, and REST API Request) Supabase action in a workflow.

I created a workflow that triggers on a text input “on change” where I use Supabase Update action to edit an object : in my table “polls” selected by the “id” (I give a hardcoded value to test), I pass the “title” (and also the owner(=user\_id) but I should not, it’s a desperate action 🥲). When ran this workflow raises an error saying :

TypeError: Cannot read properties of undefined (reading ‘id’)  
at [https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110942](https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110942)  
at Proxy.every ()  
at [https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110921](https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110921)  
at Array.findIndex ()  
at je ([https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110905](https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110905))  
at Object.onSubscribe ([https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110134](https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:110134))  
at Object.update ([https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:108772](https://cdn.weweb.io/components/f9ef41c3-1c53-4857-855b-f2f6a40b7186/ee749c13-658f-4bfb-9e09-db3f041cece0/dist/manager.js:1:108772))  
at async eval (eval at executeCode ([https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1:343949](https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1:343949)), :1:28)  
at async executeCode ([https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1:343943](https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1:343943))  
at async bt ([https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1257:37734](https://editor-cdn.weweb.io/public/js/index.ff56b997.js:1257:37734))".

I don’t get it 😕 I don’t see any of my variables ‘undefined’ - I don’t use any variable except user\_id in that request, but same problem without this parameter…

With Upsert action it’s another error saying “Error: new row violates row-level security policy (USING expression) for table “polls” at Object.upsert …” while Supabase Insert action works well (with an authentication policy with “WITH CHECK” expression), independently. I guess it’s another issue, lesser priority to me, but I wonder also.

With the REST API resquest, there it is a “Error: new row violates row-level security policy (USING expression) for table “polls” at Object.upsert …” while I’m using the apikey given in Supabase, etc…

Screenshots below : one for the Update, one for the Upsert, the other for the REST API Request…

I wonder if these 3 errors are linked.  
Thanks for your help ! (and long live WeWeb!)

 ![Screenshot 2024-01-07 at 15.38.04](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/43e747bb98d2e21e76e634169f5919a2f9c797b7.png)

 ![Screenshot 2024-01-07 at 15.38.20](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/edfeb26661fa3e77fa4bc42a7abbbd6d8de221e9.png)

 ![Screenshot 2024-01-07 at 15.38.43](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/4f2b54d123328e499853409d21647e5819aee85b.png)

---

<div class="post-metadata">

**Author:** ![Dominic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dominic/32/5645_2.png) [@Dominic](https://community.weweb.io/u/Dominic)\
**Post date:** [January 7, 2024, 5:17pm UTC](https://community.weweb.io/t/supabase-update-action-typeerror-cannot-read-properties-of-undefined-reading-id/6249/2 "2024-01-07T17:17:02Z")

</div>

Remember that for UPSERT the user needs to have INSERT, UPDATE and SELECT permissions in RLS.  
As to the first error - double check your formula under owner.

---

<div class="post-metadata">

**Author:** ![LivingStoneHgS](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LivingStoneHgS](https://community.weweb.io/u/LivingStoneHgS)\
**Post date:** [January 7, 2024, 9:19pm UTC](https://community.weweb.io/t/supabase-update-action-typeerror-cannot-read-properties-of-undefined-reading-id/6249/3 "2024-01-07T21:19:54Z")

</div>

I indeed have these 3 policies, INSERT and SELECT work on another page.  
As to the owner, it’s not the problem because I have the same error without passing this parameter (but it’s currently set to Supabase Auth - [‘user’].id and the ‘current value’ displays an uuid in the field) …

Tks

---

<div class="post-metadata">

**Author:** ![LivingStoneHgS](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@LivingStoneHgS](https://community.weweb.io/u/LivingStoneHgS)\
**Post date:** [January 8, 2024, 1:40pm UTC](https://community.weweb.io/t/supabase-update-action-typeerror-cannot-read-properties-of-undefined-reading-id/6249/4 "2024-01-08T13:40:41Z")

</div>

I even tried to add "Id"s (in HTML attributes) to the component and all its parents - doesn’t resolve. I don’t get what variable’s “id” property is missing
