cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Manilyn0509
Helper III
Helper III

How to show one employee name only if it has duplicates in sharepoint list

As shown below Manilyn and Maeson are being used six (6) times because there are six (6) types of Leave.  I used Gallery ThisItem.Employee.DisplayName it also simply show six (6) times per employee name  as it was in the sharepoint list. But is it possible to show just one name per employee in powerapps ? All I want id to make it an Employee list and show its balance leave details as I click their names. 

 

Sharepoint List:

zz.png

 

I just want it to be like this. 

yy.png

 

 

7 REPLIES 7
WarrenBelz
Super User
Super User

@Manilyn0509 ,

Not quite your format (you cannot do this), but this should get you the information required

AddColumns(
   GroupBy(
      'Balance Leave Masterlist',
      "Employee",
      "LeaveType",
      "Data"
   ),
   "LeaveNo",
   CountRows(Data),
   "AllowedCreditLeave",
   Sum(Data,Allowable),
   "UsedLeave",
   Sum(Data,Used),
   "LeaveBalance",
   Sum(Data,TotalBalance)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

To which property should I put this code on?

@Manilyn0509 ,

The Items of the gallery you mentioned.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

WarrenBelz
Super User
Super User

Hi @Manilyn0509 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi, @WarrenBelz , 

Seems like it's not working on person/group and choice column. Is there's any way? Thanks for helping . 

AddColumns.png

 

@Manilyn0509 ,

Correct - you cannot GroupBy complex field types

AddColumns(
   GroupBy(
      AddColumns(
         'Balance Leave Masterlist',
         "StaffName",
         Employee.DisplayName
      ),
      "StaffName",
      "LeaveType",
      "Data"
   ),
   "LeaveNo",
   CountRows(Data),
   "AllowedCreditLeave",
   Sum(Data,Allowable),
   "UsedLeave",
   Sum(Data,Used),
   "LeaveBalance",
   Sum(Data,TotalBalance)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

WarrenBelz
Super User
Super User

Hi @Manilyn0509 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

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.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,357)