Hi folks,
I have a gallery that is displaying employee production stats. The info is coming from a SharePoint list called SPStats.
SPStats contains one row of data for each file an employee has completed, so I use the gallery to group columns and to sum up the total number of files completed by each employee.
My gallery only has 4 columns:
1) Employee Name (lblName)
2) Total Processed (lblProcessed)
3) Week Start (lblWkStart)
4) Week End (lblWkEnd)
What I am trying to do is patch the following 4 items into a different SharePoint list called SPProduction. All items are single line of text, as are the column types I'm trying to patch them to.
My code is throwing an error that it is expecting a record value instead of a table. I'm not sure how to successfully patch these items to my list.
My current code is:
Patch(SPProduction,ForAll(gal_Stats.AllItems,{EmployeeName:lblName.Text, wkStrt:lblWkStart.Text, wkEnd:lblWkEnd.Text,TotalProcessed:lblTotalProcessed.Text}))
Can someone help out?
thank you 🙂
Solved! Go to Solution.
Hi @AuburnMist ,
Then you should need this
Patch(
SPProduction,
ForAll(
gal_Stats.AllItems As aPatch,
{
EmployeeName: aPatch.lblName.Text,
wkStrt: DateValue(aPatch.lblWkStart.Text),
wkEnd: DateValue(aPatch.lblWkEnd.Text),
TotalProcessed: aPatch.lblTotalProcessed.Text
}
)
)
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 @AuburnMist ,
One of those columns in your list must be something else than a Single Line of Text - can you please check this as the error is stating this is the issue.
Oh my gosh.. you are correct. Initially I was going to use text columns for all, but ended up using actual date columns for the wkStrt and wkEnd! Doh!
Hi @AuburnMist ,
Then you should need this
Patch(
SPProduction,
ForAll(
gal_Stats.AllItems As aPatch,
{
EmployeeName: aPatch.lblName.Text,
wkStrt: DateValue(aPatch.lblWkStart.Text),
wkEnd: DateValue(aPatch.lblWkEnd.Text),
TotalProcessed: aPatch.lblTotalProcessed.Text
}
)
)
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
Thank you so very much. It worked! I super appreciate it! 🙂
Is it possible, at the same time that I perform the above patch, to also patch another item, that is NOT inside of the gallery? I need to record the fiscal year also, but this is contained in a label outside of the gallery. the label is called lblFiscal_Stats and is a text type column.
User | Count |
---|---|
253 | |
125 | |
106 | |
50 | |
49 |