1 - 1 relationship between data types

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.

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

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.

1 Like

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).

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

1 Like