# {id} not being replaced in External Collection UPDATE (Supabase REST)

**URL:** <https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515>\
**Category:** External Collections, Custom Actions & Collections\
**Created:** [November 16, 2025, 4:33pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515 "2025-11-16T16:33:45Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 16, 2025, 4:33pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/1 "2025-11-16T16:33:45Z")

</div>

I’m really having a hard time and experiencing an issue with an External Collection connected to Supabase, where the `{id}` placeholder doesn’t seem to be substituted when performing an UPDATE.

**Setup:**

- External Collection: **Macro Inputs (External)**

- Backend: **Supabase REST API**

- Table: `macro_inputs` with primary key `id` (bigint)

- Endpoints:

Headers (for all):  
`apikey`, `Authorization: Bearer <anon_key>`, `Content-Type: application/json`, `Prefer: return=representation`

**Flow in the app:**

1. On Screen A, I create a new `macro_inputs` row (step, adalo\_user\_id).  
The row is successfully created in Supabase.

2. I then navigate to Screen B, where:

**The issue:**

When I press the Update button, Supabase returns this error:

```auto
{
  "code": "22P02",
  "details": null,
  "hint": null,
  "message": "invalid input syntax for type bigint: \"{id}\""
}

```

This means the request being sent from Adalo to Supabase still contains:

```auto
?id=eq.{id}

```

instead of something like:

```auto
?id=eq.153

```

In other words, `{id}` is not being replaced with the current record’s primary key, even though:

- The `id` field is present in the External Collection and detected as the primary key.

- The Update action is configured as **Update → Current Macro Inputs (External)** inside a list cell.

- A row definitely exists in the list (I can see it in Supabase and filter it by `adalo_user_id`).

**My question:**

Is there a known issue or specific requirement for `{id}` substitution in External Collections when:

- Using Supabase REST with URLs like `?id=eq.{id}`, and

- Updating from within a list item using **Update → Current [External Collection]**?

Any guidance on why `{id}` would remain literal in the outgoing request (and not be replaced by the current record’s ID) would be really helpful.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [November 16, 2025, 8:24pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/2 "2025-11-16T20:24:16Z")

</div>

Hi @bttrszn,

You’re using a custom action for update the record? If it is, you need to map the id with an input like this. :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/e/4/e4d00c5f8c6e85d1766ecc3ac357645fc39b793f.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/5/0/50125464d7a6d2b43e135eff53a725f9160fb377.png)

Let me know!

Thank you and have a great day!

---

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 16, 2025, 8:42pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/3 "2025-11-16T20:42:29Z")

</div>

Hi @Dilon,

I’m not using a custom action as I am not familiar with it yet (non-tech person here :D). I’m using the normal update action from the API Test Set-up tho but I can try doing that too. I’ll let you know ina bit 🙂 Thank you!

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [November 16, 2025, 8:43pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/4 "2025-11-16T20:43:59Z")

</div>

No worries @bttrszn, thanks for the update! Where do you see the above error message? Inside the app or in Supabase?

---

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 16, 2025, 8:49pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/5 "2025-11-16T20:49:25Z")

</div>

I see the error code 22P02 inside the app when I preview it but I went to the devtools to check the actual error message.

---

<div class="post-metadata">

**Author:** ![Ali-Bazzi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/ali-bazzi/32/40359_2.png) [@Ali-Bazzi](https://forum.adalo.com/u/Ali-Bazzi)\
**Post date:** [November 16, 2025, 8:54pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/6 "2025-11-16T20:54:30Z")

</div>

Hello @bttrszn, If you’re seeing 22P02 in the preview and the devtools show {id} literally being sent, then the record isn’t passing the actual primary key into the update call. A few things to double check:

Make sure the id field is returned in both GET ALL and GET ONE. If the list item doesn’t contain a real id, the placeholder won’t be substituted.

Supabase bigint can sometimes be interpreted as text, which blocks substitution. Exposing the id as an integer (or through a view) usually fixes it.

Using {id} in the query string (?id=eq.{id}) isn’t always reliable. An endpoint with /macro\_inputs/{id} works consistently.

If you share your GET ALL response (without sensitive data), I can tell you exactly where the issue is coming from.

Thank you!

Ali bazzi

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [November 16, 2025, 9:59pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/7 "2025-11-16T21:59:26Z")

</div>

Hi @bttrszn,

Aha, gotcha and thanks for the information!

Should be a simple fix, instead one curly bracket, add two \> save \> should be good! I mean when setting up the external collection. ( for example, instead this : https://[project].supabase.co/rest/v1/macro\_inputs?id=eq.{id}, make it like this : https://[project].supabase.co/rest/v1/macro\_inputs?id=eq.{{id}} )

Let me know!

Thank you and have a great day!

---

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 16, 2025, 10:25pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/8 "2025-11-16T22:25:22Z")

</div>

Thanks @Dilon! I tried this and there’s no error code but I couldn’t see the components on the next screen (screen b). It looks like the CREATE action on Screen A didn’t work although I can see rows were created on Supabase.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [November 16, 2025, 10:27pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/9 "2025-11-16T22:27:02Z")

</div>

You’re very welcome @bttrszn! Would you be able to provide a quick screen recording with loom showing your current setup and preview?

---

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 16, 2025, 10:31pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/10 "2025-11-16T22:31:16Z")

</div>

Hi @Ali-Bazzi,

Thanks so much sharing that with me. I figured there’s something wrong with ?id=eq.{id} but here’s my GET all response:

[  
{  
“id”: 1,  
“created\_at”: “2025-11-10T16:14:36+00:00”,  
“goal”: “test”,  
“activity\_level”: “Sedentary”,  
“gender”: “Male”,  
“age”: 28,  
“weight\_kg”: 84,  
“progress\_speed”: “moderate”,  
“calculation\_method”: “AI”,  
“calories”: 1000,  
“protein\_g”: 1300,  
“carbs\_g”: 800,  
“fat\_g”: 200,  
“completed\_at”: “2025-11-10T16:18:07+00:00”,  
“step”: 1,  
“activity\_k”: 8,  
“speed\_pct”: 1,  
“protein\_per\_lb”: 1,  
“legal\_age”: true,  
“height\_cm”: 174,  
“BMR”: 1,  
“TDEE”: 1,  
“protein”: 1,  
“calories\_g”: 1,  
“adalo\_user\_id”: “1”  
}  
]

---

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 16, 2025, 10:41pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/11 "2025-11-16T22:41:08Z")

</div>

Thank you, @Dilon! Loom is currently lagging right now but I screen-recorded it and saved it on my drive. Do you have an email where I can send it to?

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [November 16, 2025, 11:05pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/12 "2025-11-16T23:05:02Z")

</div>

Hi @bttrszn,

No worries and I can send that but could you confirm if it’s the same in your settings?

1. GET ALL : https://[your-project-id].supabase.co/rest/v1/macro\_inputs?select=\* (GET)
2. GET ONE : https://[your-project-id].supabase.co/rest/v1/macro\_inputs?id=eq.{{id}}&select=\* (GET)
3. CREATE : https://[your-project-id].supabase.co/rest/v1/macro\_inputs (POST)
4. UPDATE : https://[your-project-id].supabase.co/rest/v1/macro\_inputs?id=eq.{{id}} (PATCH)
5. DELETE : https://[your-project-id].supabase.co/rest/v1/macro\_inputs?id=eq.{{id}} (DELETE)

Thank you and have a great day!

---

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 16, 2025, 11:07pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/13 "2025-11-16T23:07:36Z")

</div>

Hi @Dilon, yes. Its the same

---

<div class="post-metadata">

**Author:** ![Ali-Bazzi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/ali-bazzi/32/40359_2.png) [@Ali-Bazzi](https://forum.adalo.com/u/Ali-Bazzi)\
**Post date:** [November 17, 2025, 2:42pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/14 "2025-11-17T14:42:13Z")

</div>

Hello @bttrszn, you’re very welcome!

Thanks for sharing the GET ALL response. Your `id` is coming through correctly, but **your `adalo_user_id`** is returned as a string (“1”) instead of a number. When the list is filtered by `adalo_user_id = Logged-In User > id` and one side is numeric while the other is a string, the record loads visually but the underlying item doesn’t bind fully, especially the primary key. That’s why `{id}` stays literal during the update.

You have two options that you can try to fix it:

1. **Store `adalo_user_id`** in Supabase as a numeric type, not text.

2. Or expose it through a view as an integer.

After that, the list will pass the full record (including the PK), and the update request will correctly substitute the real ID.

Thank you!

Ali Bazzi

---

<div class="post-metadata">

**Author:** ![bttrszn](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bttrszn](https://forum.adalo.com/u/bttrszn)\
**Post date:** [November 17, 2025, 7:33pm UTC](https://forum.adalo.com/t/id-not-being-replaced-in-external-collection-update-supabase-rest/59515/15 "2025-11-17T19:33:33Z")

</div>

This worked! I also added Query Parameter for: adalo\_user\_id = iq.{logged in user \> id}, limit = 1 and order = id.desc to make sure the flow works. I also had to delete all actions and conditional visibility from the screen b and set it right back. Thank you, @Dilon !!
