Using Aggregate to group by

I'm new at OutSystems I'm trying to build an application. as you can see I have two entities one is project and one is Users that have a relationship between them. 

I want to display records to avoid duplicates but I got a problem. it's unable to show all columns on the table. only can show the column that we use group by. I tried to research on outsystem community but can't see any solution. sorry for my bad English. if didn’t understand I will explain more. thank you!


Screen Shot 2021-11-14 at 11.35.49 PM.png

mvp_badge
MVP

Hi Noch,

Welcome to the OutSystems community.

You can group by attributes in an attribute from with the aggregate editor.

See the following documents on how to do it:

Regards,

Daniel

Hi Noch,

one suggestion for your data model:

  • Unless you are sure a User will only work in a single project, you should create a new entity called ProjectUser (Id, ProjectId, UserId) instead of the ProjectId attribute in Users entity. 

I'm not sure if I understood correctly what you need, but if you want to display the data of your Projects without duplicated records, you only need to select all attributes of Project entity and choose Group by selected attributes.

Best regards

To avoid duplicate records in this new Entity (ProjectUser), it may be useful to create an Unique Index with both Reference Attributes (ProjectId, UserId).

Hi Noch,

If I understand correctly then you are trying to show list of Users for each Project.

If it is the case so I implemented a small demo, you can take a look at this live demo. For displaying Users column I used ";" as separator, however we can update it base on what we needed.

I'll share the .oml file if it solves your issue.

Regards,

Khuong


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