# Query a users relational records in Xano

**URL:** <https://community.weweb.io/t/query-a-users-relational-records-in-xano/2844>\
**Category:** Ask us anything\
**Tags:** xano\
**Created:** [May 28, 2023, 1:16am UTC](https://community.weweb.io/t/query-a-users-relational-records-in-xano/2844 "2023-05-28T01:16:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesa](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@jamesa](https://community.weweb.io/u/jamesa)\
**Post date:** [May 28, 2023, 1:16am UTC](https://community.weweb.io/t/query-a-users-relational-records-in-xano/2844/1 "2023-05-28T01:16:16Z")

</div>

Hi,

I’ve run into an issue with filtering a collection. My app has a Xano data with 3 tables. Users, Companies and Loads.

The user table has a relational field to the Company table (company\_id). The loads field has a relational field to the Company field (company\_id). So this would mean a company has many loads and many users.

I created a customer API endpoint in Xano for the loads table that takes an input of (company\_id). When a user logs in, I want to display a table of that users companies loads.

When I go to setup the collection in Weweb I run into an issue binding the company\_id input the API requires with the users stored company\_id. The only fields available to me are user\_id, created\_at, name, email, role etc…

 ![Screenshot 2023-05-27 at 9.10.32 PM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/c/c275db2e4fb7639b9162593bf7c956d30dae7972.png)

I tried to look back through the Xano Auth setup to see if there was something I was missing in making this extra field available for the user but haven’t been able to find anything.

My ultimate goal with this setup is to allow multiple users to belong to and post available loads under the same company. If there is a better way to set this up I am all ears but I would also like help making this relational field available for binding in weweb.

---

<div class="post-metadata">

**Author:** ![jamesa](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@jamesa](https://community.weweb.io/u/jamesa)\
**Post date:** [May 28, 2023, 1:36am UTC](https://community.weweb.io/t/query-a-users-relational-records-in-xano/2844/2 "2023-05-28T01:36:06Z")

</div>

Well that didn’t take long but I figured it out 🙂

If anyone comes across this post in the future, my issue was location in Xano and the output of the auth/me endpoint. Under the function stack, I needed to update the output from Get Record from USER to include the company\_id.

After refreshing all my connections the company\_id became available under the user auth in weweb.

---

<div class="post-metadata">

**Author:** ![Quentin](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/quentin/32/6_2.png) [@Quentin](https://community.weweb.io/u/Quentin)\
**Post date:** [May 30, 2023, 8:43am UTC](https://community.weweb.io/t/query-a-users-relational-records-in-xano/2844/3 "2023-05-30T08:43:46Z")

</div>

What I like to do is also filter the GET endpoints in Xano by the user auth id (from the auth token) by default, so you know that the data is filtered for the current user by default 😉
