cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DAY
New Member

PATCH function not sending data correctly to Excel file in OneDrive

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!

1 ACCEPTED SOLUTION

Accepted Solutions
v-JessicaG-msft
Community Support
Community Support

Hi @DAY ,

 

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

View solution in original post

1 REPLY 1
v-JessicaG-msft
Community Support
Community Support

Hi @DAY ,

 

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,730)