Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Bulk Patch SharePoint list from Dynamically filtered table * UPDATE *

(0) ShareShare
ReportReport
Posted on by 37

Good day, PowerApp Pro's

 

** Anyone able to chime in? I'm trying to filter a table based on WorkerName and patch all grouped results to a SP List in one call (the number of Worker Names is dynamic and will be different everytime) **

 

I am struggling to wrap my brain around this one... My requirement is to patch multiple records to a SP list called; 'User Time Summary' with filtered dynamic table data as single record entries. I have a shaped table that contains data to populate the time summary with a filter key column called WorkerName, and I can use a ForAll to insert all records into the SP list with no issue:

 

 

With({wMergedTicketData:
 With(
 {
 outputTable: Ungroup(
 Table( 
 {tableObject: colCurrentTicketLabour},
 {tableObject: RenameColumns(Filter(colCurrentTicketTruck, TruckUserSubContractorTruck = "true"), "TruckUserName", "WorkerName")},
 {tableObject: RenameColumns(Filter(colCurrentTicketEquipment, ContractorChargeOut <> Blank() And ContractorPrefix <> Blank()), "UserFullName", "WorkerName")}

 ),
 "tableObject"
 )
 },
 ShowColumns( 
 GroupBy(
 outputTable,
 "WorkerName", "WorkerRegularTime", "WorkerOverTime", "WorkerTravelTime", "WorkerDivision", "WorkerAreaCode", "WorkerUserSubContractor", "WorkerUserJobTitle", "WorkerUserJobTitleCode", "WorkerUserNumber", "UserPayrollLabourRate", "Subsistence", "SubsistencePayrollAmount","TruckUserSubContractor", "TruckUserSubContractorTruck", "TruckUserNumber", "UserPayrollTruckHrRate", "UserPayrollTruckKmRate", "TruckRateType", "OtherTruckRateType", "TruckRateQuantity", "ContractorChargeOut", "ContractorPrefix", "EquipmentQuantity", "EquipmentPayRollRate", 
 
 "Grouped"
 ),
 "WorkerName", "WorkerRegularTime", "WorkerOverTime", "WorkerTravelTime", "WorkerDivision", "WorkerAreaCode", "WorkerUserSubContractor", "WorkerUserJobTitle", "WorkerUserJobTitleCode", "WorkerUserNumber", "UserPayrollLabourRate", "Subsistence", "SubsistencePayrollAmount", "TruckUserSubContractor", "TruckUserSubContractorTruck", "TruckUserNumber", "UserPayrollTruckHrRate", "UserPayrollTruckKmRate", "TruckRateType", "OtherTruckRateType", "TruckRateQuantity", "ContractorChargeOut", "ContractorPrefix", "EquipmentQuantity", "EquipmentPayRollRate"
 )
)},

 ForAll(wMergedTicketData, Patch('User Time Summary', {
 
 Title: "Time Entry",
 'Time Summary Number': "EMP001",
 'User Full Name': ThisRecord.WorkerName,
 'User Number': ThisRecord.WorkerUserNumber,
 'User Job Title Code': ThisRecord.WorkerUserJobTitle,
 'Ticket Date': First(recTicketApprovalsCurrent.TicketDate).TicketDate,
 'Job Number': First(recTicketApprovalsCurrent.JobNumber).JobNumber,
 'Ticket Number': First(recTicketApprovalsCurrent.TicketNumber).TicketNumber,
 'Customer Name': First(recTicketApprovalsCurrent.CustomerName).CustomerName,
 'User Division Area Code': ThisRecord.WorkerDivision & ThisRecord.WorkerAreaCode,
 'User SubContractor': ThisRecord.WorkerUserSubContractor,
 'User SubContractor Truck': ThisRecord.TruckUserSubContractorTruck,
 'User SubContractor ChargeOuts': ThisRecord.ContractorChargeOut
 
 })
 )
)

 

 

However, I haven't been able to work out how to filter these records by WorkerName first, then patch that result (with all required  columns) as a single flattened record entry before moving on to the next dynamic WorkerName patching those filtered columns until the table is empty... 

 

Would greatly appreciate any/all input on how to efficiently achieve this patching scenario.

 

Thanks in advance!

 

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard