401
Views
11
Comments
Solved
aggregate shows duplicate data in table widget
Application Type
Reactive

I have a table on the screen. In this table i am using a aggregate with many different entities. However when i want to list the data in table, the table shows duplicate data. See image: 


You see for the same Naam it shows all the data in different rows. It should look something like this:

because Outsystems Mobile developer, Azure fundamentals, dit is een test and dit is een testdd belongs to the User Sa..... All of them are connected to the user but it shows each of them in different rows


The aggregate looks like this:

and this is the table:


2022-12-09 04-50-17
Shubham Doshi
Solution

Hello Sam,

There are multiple records available in database, however same is reflecting on the screen. If you want to make it in a single line. You can use a block to enclose an expression of listing all the certification in a single line.

If you could share your OML that would be great. Or let me know if you need a demo.

2023-03-16 04-58-56
Ashish Lonkar

Hello Sam,

This certainly looks like an issue arising due to joins of ur table.

Check the joins in aggregate or share your oml/oap with me and I will look into it for you.

Thanks!

UserImage.jpg
sam m

Hello Ashish,


thank you for your reply. I can send you images. These are the joins of the aggregate: 


do you need more details? please let me know

UserImage.jpg
Vidhi Rajput

Hi sam m,

I was not able to find root cause of the issue by seeing image provided by you but what I can imagine it might be possible there can be multiple same record in any of the tables.

Can you please try to group by column which you want to show on UI, I think it can be solve your problem.

Hope it's helpful

Thanks

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

Hi sam,

While inserting record you need to prevent duplicates. But I am not sure about your usecase.

You can group by username in aggregate and check it out. If its not work then please share sample oml file then we can give it a try to find the solution. 

Thanks,

Ajit Kurane.

UserImage.jpg
sam m

hello, if i group by Username, it gives me this error

It does not recognise the expressions in the table:


2025-02-12 23-46-07
Rúben Simões
Champion

I believe you can't use a single aggregate to solve your problem, only with an advanced SQL query to get all the different Certificaat/Skill by Naam, or you could create a Block with NaamId input, and get all the Certificaat or Skill from that Naam presented in a expression.

Thanks,

Rúben Simões

2022-12-09 04-50-17
Shubham Doshi
Solution

Hello Sam,

There are multiple records available in database, however same is reflecting on the screen. If you want to make it in a single line. You can use a block to enclose an expression of listing all the certification in a single line.

If you could share your OML that would be great. Or let me know if you need a demo.

2024-05-20 09-45-12
Jean Bastos

Hi Sam,

For what you want, the best is using SQL to get data in the format you want.
If you are not comfortable with it you can use a block as was told up here.

And you still have another option... in the OnAfterFetch event you can iterate your aggregate and build your own structure list to use your table. Be aware that this solution is not the best thing  in terms of good practices and performance if you have many records.

UserImage.jpg
sam m

i created a block with Skill aggregate and added a list to this block. And added this block to the Table.

@Shubham Doshi @Rúben Simões 


however i do not understand how to setup the joins so that it will only show the Skills per user name. Right now it shows allt he Skills that are in the database, even Skills of other Users. Does any of you have a Demo?

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

Hi Sam,

let me first say : for learning purposes, having a block with it's own aggregate is ok, but for professional application, beware that this means a drawback on performance/network traffic.  If you show 10 users at a time in your list, this means 21 roundtrips to the server (1 for the list, 10 for the certificaat blocks and 10 for the skill blocks)

What you need for this is an input of DigitaleCV identifier into your blocks, and then join your DigitaleCV with Certificaat or Skill and filter on that ID.

Dorine

2022-12-09 04-50-17
Shubham Doshi

There should be User Identifier attribute in Skills entity to uniquely identify skills of every. Then you will have to join Skills & Users entity to get skills per user. 

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