web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create Data Table from...
Power Apps
Unanswered

Create Data Table from Sharepoint Lists and Filter

(0) ShareShare
ReportReport
Posted on by 997 Super User 2024 Season 1

Hi,

I want to create a data table based on 2 Sharepoint lists, Employee and Application Record.

 

The data table has EmployeeName column based on the Employee list

 

anonymous21_0-1658196143972.pngName is people column

 

Besides EmployeeName, there are AnnualLeave, CalamityLeave,CarryForwardLeave and etc for each of the employee based on Application Record list. Each of the columns sums the Approval Status: Approved and Total Days Applied.

anonymous21_1-1658196419958.png

 

 

I tried this formula below but it doesn't display all names and sums up all employees Total Days Applied.

 

 

ClearCollect(employeeName, ShowColumns(Employee,"Name"));
ClearCollect(var,ForAll(employeeName,Name).DisplayName);

ClearCollect(annualApproved,Filter('Application Record','Leave Type'.Value="Annual Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(calamityApproved,Filter('Application Record','Leave Type'.Value="Calamity Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(carryForwardApproved,Filter('Application Record','Leave Type'.Value="Carry Forward Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(emergencyApproved,Filter('Application Record','Leave Type'.Value="Emergency Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(hospitalizationApproved,Filter('Application Record','Leave Type'.Value="Hospitalization Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(maternityApproved,Filter('Application Record','Leave Type'.Value="Maternity Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(paternityApproved,Filter('Application Record','Leave Type'.Value="Paternity Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(sickApproved,Filter('Application Record','Leave Type'.Value="Sick Leave" && 'Approval Status'.Value="Approved"));
ClearCollect(quarantineApproved,Filter('Application Record','Leave Type'.Value="Quarantine Leave" && 'Approval Status'.Value="Approved"));

ClearCollect(table1, 
Table( {
EmployeeName: var.DisplayName, 
AnnualLeave: Sum(annualApproved,'Total Days Applied'),
CalamityLeave:Sum(calamityApproved,'Total Days Applied'),
CarryForwardLeave:Sum(carryForwardApproved,'Total Days Applied'),
EmergencyLeave:Sum(emergencyApproved,'Total Days Applied'),
HospitalizationLeave:Sum(hospitalizationApproved,'Total Days Applied'),
MaternityLeave:Sum(maternityApproved,'Total Days Applied'),
PaternityLeave:Sum(paternityApproved,'Total Days Applied'),
SickLeave:Sum(sickApproved,'Total Days Applied'),
QuarantineLeave: Sum(quarantineApproved,'Total Days Applied')}
));

 

 

anonymous21_2-1658196521098.png

I need to create Name and then their respective leave type and Total Days Applied for themselves. Use Filter? How to do that?

 

Thank you.

Categories:
I have the same question (0)
  • RusselThomas Profile Picture
    4,014 on at

    Hi @syhrh ,

    I think I already answered this here?

    Re: Display all rows from a column from Sharepoint - Power Platform Community (microsoft.com)

    Kind regards,

    RT

  • syhrh Profile Picture
    997 Super User 2024 Season 1 on at

    Hi @RusselThomas,

    there are still some issues with the data table but the sum for the total days applied for only 2 employees is correct. Others are grouped together.

    anonymous21_0-1658237476065.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard