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 / PATCH function not sen...
Power Apps
Answered

PATCH function not sending data correctly to Excel file in OneDrive

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi folks,

 

I am trying to create a simple barcode scanner app for my team to use. The app worked file but it cannot send the barcode data to the Excel file. The Excel file is connected to my app via PowerApps Connector. My app interface:

Screenshot_20220110-170629_Power Apps.jpg

My "Scan Barcode" button has the following action syntax:

Set(varScan, BarcodeScanner1.Value); Set(varTimeScan, Now()); Collect(scanneditems, Table({Scan: varScan, TimeScanned: varTimeScan}))

 

I have used the following COLLECT syntax to place the data within the 'scanneditems' collection in my PowerApps:

Collect(scanneditems, {BarcodeValue: BarcodeValueLabel.Text, TimeScan: TimeScanValueLabel.Text})

 

For my button "Upload to Excel", I have used the following:

ForAll(
scanneditems,
Patch( Table1, Defaults(Table1),
{BarcodeValue: varScan, TimeScanned: varTimeScan})

)

 

However, the data sent across to Table 1 (which is inside an Excel in OneDrive) is gibberish. Instead of the above 4 sets of barcodes, my Table 1 is filled with gibberish in the 3rd unknown column as shown:

Screenshot_20220110-170747_OneDrive.jpg

 

Can anyone advise what has gone wrong here? Your advice is very much appreciated!

Categories:
I have the same question (0)
  • Verified answer
    v-JessicaG-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Did you create four columns with different names in the "scanneditems" collection? Do you want to add the values from the collection to Excel table1?( Which two columns of values )

     

    If you add values from the "scanneditems" collection table to Excel table1, you should use the column names of the "scanneditems" table instead of the variable names in the patch function. I have test for your reference, please refer to the screenshot:

     

    vJessicaGmsft_0-1641977601655.png

    vJessicaGmsft_1-1641977601659.png

     

     

    Best Regards,

    Jessica Gu

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard