# 1 - 1 relationship between data types

**URL:** <https://forum.bubble.io/t/1-1-relationship-between-data-types/268775>\
**Category:** Database\
**Created:** [June 20, 2023, 8:13pm UTC](https://forum.bubble.io/t/1-1-relationship-between-data-types/268775 "2023-06-20T20:13:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![opeyemi.obayemi](https://avatars.discourse-cdn.com/v4/letter/o/9fc348/32.png) [@opeyemi.obayemi](https://forum.bubble.io/u/opeyemi.obayemi)\
**Post date:** [June 20, 2023, 8:13pm UTC](https://forum.bubble.io/t/1-1-relationship-between-data-types/268775/1 "2023-06-20T20:13:36Z")

</div>

Hi All,

There are a few data types in my project, 2 of which are USER DATA and COMPANY. A 1 - 1 relationship exists between the two types, and the database has been structured to reflect this relationship.

The challenge is that I am not quite sure how to ensure that the Company Name entered into the COMPANY data type is also submitted into the USER DATA data type so that I can easily see the company a user works for.

Kindly assist.

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [June 20, 2023, 8:27pm UTC](https://forum.bubble.io/t/1-1-relationship-between-data-types/268775/2 "2023-06-20T20:27:23Z")

</div>

Hi there, @opeyemi.obayemi… I’m not exactly sure what you mean when you say you want the company name to also be submitted into the `USER DATA` data type, but what you need is a `company` field in the `USER DATA` data type, and that field should have its field type set to the `COMPANY` data type. Then, when a user is associated with a company (however that happens in your app), populate the `company` field in the `USER DATA` data type with the company itself (not the company name or any other piece of data related to the company), and you will be able to access all of the company’s data through the association in `company` field. Does that sound like what you are trying to do?

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![opeyemi.obayemi](https://avatars.discourse-cdn.com/v4/letter/o/9fc348/32.png) [@opeyemi.obayemi](https://forum.bubble.io/u/opeyemi.obayemi)\
**Post date:** [June 20, 2023, 9:28pm UTC](https://forum.bubble.io/t/1-1-relationship-between-data-types/268775/3 "2023-06-20T21:28:40Z")

</div>

Thanks @mikeloc. What you described is exactly what I was trying to do. The mistake I made was trying to populate the `company` field in the `USER DATA` data type with the company name instead of the company itself. I am now seeing the unique id of the company in the `COMPANY` data type in the `company` field in the `USER DATA` data type. Thanks.

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [June 20, 2023, 9:32pm UTC](https://forum.bubble.io/t/1-1-relationship-between-data-types/268775/4 "2023-06-20T21:32:20Z")

</div>

If you want to see the company name in that field instead of the unique id, click the _Primary fields_ button in the upper left of the _App data_ tab, and change the primary field for the `COMPANY` data type to the company name (note that the change is only for display purposes).

---

<div class="post-metadata">

**Author:** ![opeyemi.obayemi](https://avatars.discourse-cdn.com/v4/letter/o/9fc348/32.png) [@opeyemi.obayemi](https://forum.bubble.io/u/opeyemi.obayemi)\
**Post date:** [June 20, 2023, 9:49pm UTC](https://forum.bubble.io/t/1-1-relationship-between-data-types/268775/5 "2023-06-20T21:49:05Z")

</div>

Really appreciate the additional guidance @mikeloc. I can now see the company name and not the unique id. Thanks a bunch.
