# Fix for Lookup Failure Due to Custom Column Names in WeWeb

**URL:** <https://community.weweb.io/t/fix-for-lookup-failure-due-to-custom-column-names-in-weweb/14122>\
**Category:** Tips and Hacks\
**Tags:** lookup, supabase, weweb\
**Created:** [October 24, 2024, 2:49am UTC](https://community.weweb.io/t/fix-for-lookup-failure-due-to-custom-column-names-in-weweb/14122 "2024-10-24T02:49:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rice](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/rice/32/11161_2.png) [@rice](https://community.weweb.io/u/rice)\
**Post date:** [October 24, 2024, 2:49am UTC](https://community.weweb.io/t/fix-for-lookup-failure-due-to-custom-column-names-in-weweb/14122/1 "2024-10-24T02:49:09Z")

</div>

Hi everyone,

I wanted to share a bug I encountered and the solution I found, in case it helps someone else.

I have my WeWeb setup with Supabase for the backend, with three key tables: `clients`, `vehicles`, and `bookings`. Each table has a unique ID column (`client_id`, `vehicle_id`, and `booking_id` respectively), which I renamed from the default `id` for clarity.

In the `bookings` table, I use foreign keys to link `client_id` and `vehicle_id` from the `clients` and `vehicles` tables, so my booking data only contains the IDs instead of full client and vehicle info.

Everything worked fine until I hit an issue while trying to bind the data on the frontend. The `lookup` function failed when trying to retrieve related data using the foreign key columns. After much trial and error, I discovered that removing the prefixes from the ID column names in the lookup formula (e.g., changing `vehicle_id` back to `id`) fixed the issue.

This seems to be a quirk in WeWeb, Supabase, or PostgreSQL, but I wanted to share my experience since I couldn’t find this solution online. Hopefully, it helps anyone encountering a similar issue.

As for why I renamed the IDs in the first place, I misunderstood some documentation and thought making column names unique would prevent future problems. Turns out that in this case, it caused one!

Has anyone else encountered this? I’d love to hear if there’s a better way to handle this or if it’s just a bug.

---

<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:** [October 24, 2024, 5:55am UTC](https://community.weweb.io/t/fix-for-lookup-failure-due-to-custom-column-names-in-weweb/14122/2 "2024-10-24T05:55:00Z")

</div>

Hey, you probably shouldn’t use a lookup function. I wrote an article about this.

> **[Become a Supabase Magician in WeWeb (Tutorial With Examples) – Broberto](https://broberto.sk/radar/weweb/become-a-supabase-magician-in-weweb-with-examples/)**
>
> Discover advanced techniques for using Supabase with WeWeb. Enhance your apps with these advanced examples and interactive WeWeb examples.
