cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pallavigade
Microsoft
Microsoft

Remove duplicates in subgrid or custom view

Hi Team,

I am new to the power apps. I was checking if is there any way to avoid duplicate records in power apps subgrid or in a custom view?

 

I have a records something like below:

Id   Name

1    foo

1    foo

2    bar

2    bar

 

expected result in subgrid\custom view:

1 foo

2 bar

 

Please let me know if need any additional details. I appreciate the help.

1 ACCEPTED SOLUTION

Accepted Solutions
pallavigade
Microsoft
Microsoft

Thanks everyone for your views, I kind of mitigated it my creating a separate entity with unique values. Creating a custom number attribute might work too

View solution in original post

4 REPLIES 4
chleverenz
Super User
Super User

@pallavigade ,

the data in the subgrid (well, in every list) is the data from the dataverse. So, when the records are doubled it means, that you have them twice in the table (with diffrent guids).

Usually i highly recommend to avoid that kind of scenarios in the data as nobody will be able to distinguish between the right and wrong entry. So, this would mean that this is a problem of the business process within the crm/dataverse and should be revisited/clarified.

 

You could get this also by for example selecting the names and ids from a salesorderdetail and show the information about the salesorder (or whatever master-detail relation you have). In this case think about showing the data from the master table and not from the details table.

 

You could try to add a "distinct" option in the fetch (i think, this is not possible by standard custimizing, but not sure). But this only helps, if the resultentries are really the same.

 

If all else fails you could consider rendering the data on your own by for example creating a pcf for that (did not explore this option, just thought about it 🙂 ) or by creating a custom pagetemplate which renders things lik,me you want.

 

So, no real answer, may be you post a little bit more about the challenge 🙂

 

A happy new year to you,

  Christian

Soundharya
Helper III
Helper III

Distinct(Tablename, columnname)

v-qiaqi-msft
Community Support
Community Support

Hi @pallavigade,

You can create one custom number attribute in your sub-grid entity. When any new record is added or created, assign incremental number to custom number attribute. now for sub-grid view add filter to show only records with custom attribute number =1.

So if you have 2 records with same contact, department, project & task,then custom number values will be like 1 & 2, and you are going to show only 1 record based on filter.

 

Best Regards,
Qi
pallavigade
Microsoft
Microsoft

Thanks everyone for your views, I kind of mitigated it my creating a separate entity with unique values. Creating a custom number attribute might work too

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Users online (1,400)