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 Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,261)