# How to Establish a FK in a Child Table

**URL:** <https://forum.bubble.io/t/how-to-establish-a-fk-in-a-child-table/32439>\
**Category:** Database\
**Created:** [June 30, 2018, 3:15am UTC](https://forum.bubble.io/t/how-to-establish-a-fk-in-a-child-table/32439 "2018-06-30T03:15:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akerezy](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@akerezy](https://forum.bubble.io/u/akerezy)\
**Post date:** [June 30, 2018, 3:15am UTC](https://forum.bubble.io/t/how-to-establish-a-fk-in-a-child-table/32439/1 "2018-06-30T03:15:04Z")

</div>

Hi,  
I have an auction database. Each auction will have bids by different users over time.

I have two tables or objects or things or whatever this software calls them 1) auction and 2) bids and yes, a user table which is a default table.

> **[Bubble - Visual Programming](https://actionmaster5000.bubbleapps.io/version-test?debug_mode=true)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

The auction table is prepopulated with 3 rows or 3 unique auction items, a Chevy Camaro, a bottle of water and a laptop. The user can log in and bid on the items. The link is above.

When a user bids on an auction item, I want to store the FK or the unique identifier of the auction into the bid table, but HOW?

1. what field should I add to the bid table, and what data type should it be
2. how do set that through the UI? right now when a user selects the item they want to bid on, a popup appears and they put in the bid amount, when they click the submit on the popup, I use the workflow to create a new thing, a new bid… but how can I set the FK to be of the data type auction.

Thanks  
Alex

 ![auction-FK](https://us1.discourse-cdn.com/bubble/original/3X/d/c/dcdc9e746b80855cfe351e104153f3cce27934b9.jpg)

HELP… in the bids table, I want to store the

---

<div class="post-metadata">

**Author:** ![akerezy](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@akerezy](https://forum.bubble.io/u/akerezy)\
**Post date:** [June 30, 2018, 3:35am UTC](https://forum.bubble.io/t/how-to-establish-a-fk-in-a-child-table/32439/2 "2018-06-30T03:35:13Z")

</div>

HI… I got this to work.
