127
Views
4
Comments
Solved
Add Rows under the same attribute entity ID
Question

I am trying to do a one to many relationship practice. Where by one project can have many personnel working under it.

I made a custom entity attribute ID "Project Name" of type Text.

How do I go about adding additional employee under the same Project Name by increasing the number of rows of project personnel but not adding rows of Description and Project_Name. 




This is the updated output I am looking for in the DataBaseOne

Thank you.

2025-04-17 05-42-16
Ajit Kurane
Solution

Hello Isaiah Chan,

You can achieve  your possible outcome with below entity diagram also,

and here you can learn basic things about entity relationship

Please go through below document.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships


Hope it helps you.

Regards,

Ajit Kurane.


2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

Add a DataBaseOne id (in your case DataBaseOne.ProjectName ) to your Project_Personnel entity
As Many Project_Personnel can have the same DataBaseOne record.

In your database model, you can assign multiple DataBaseOne records to the same employee rather than multiple employees to the same DataBaseOne

For readability I would not change the name of the id of the table. Just leave it as id and if you need a name for your projects just add an attribute name.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi Isaiah,

you are saying you are practicing 1-to-many relationships, but i suspect what you are really looking at here is a many-to-many. 

So for that, you would need an extra junction entity holding all project-employee combinations.

so you'd have

Entity DatabaseOne

Id | Name

108  |  Project name 1

44    |  Project name 2

Entity Employee

Id |  Name

11  |  Tom

12   |  John

13  |  Dick

14  |  Harry

Entity DatabaseOneEmployee

DabaseOneId      |     EmployeeId

108                         |     11

108                         |     13

108                         |    14

44                           |     12

44                           |     13


above means you have Tom, Dick and Harry working on project 1, and John and Dick on project 2

2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

Add a DataBaseOne id (in your case DataBaseOne.ProjectName ) to your Project_Personnel entity
As Many Project_Personnel can have the same DataBaseOne record.

In your database model, you can assign multiple DataBaseOne records to the same employee rather than multiple employees to the same DataBaseOne

For readability I would not change the name of the id of the table. Just leave it as id and if you need a name for your projects just add an attribute name.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Hi Isaiah,

you are saying you are practicing 1-to-many relationships, but i suspect what you are really looking at here is a many-to-many. 

So for that, you would need an extra junction entity holding all project-employee combinations.

so you'd have

Entity DatabaseOne

Id | Name

108  |  Project name 1

44    |  Project name 2

Entity Employee

Id |  Name

11  |  Tom

12   |  John

13  |  Dick

14  |  Harry

Entity DatabaseOneEmployee

DabaseOneId      |     EmployeeId

108                         |     11

108                         |     13

108                         |    14

44                           |     12

44                           |     13


above means you have Tom, Dick and Harry working on project 1, and John and Dick on project 2

2025-04-17 05-42-16
Ajit Kurane
Solution

Hello Isaiah Chan,

You can achieve  your possible outcome with below entity diagram also,

and here you can learn basic things about entity relationship

Please go through below document.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships


Hope it helps you.

Regards,

Ajit Kurane.


UserImage.jpg
Isaiah Chan

Thank you for the response guys, I tried all the different solutions that were provided and I am able to achieve the desired results.



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.