web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Scanner app and storin...
Power Apps
Answered

Scanner app and storing records in Sharepoint List

(0) ShareShare
ReportReport
Posted on by

Hello Everyone, im looking for some help.

 

I'm trying to build a simple scanner app in power apps that captures the barcode value of a pallet, and then captures multiple barcodes of the contents of that pallet.These data captures should them be stored into a sharepoint online list.

Since i'm a complete newbie to powerapps , i'm having some difficulties, especially storing the records in sharepoint.

 

I have two barcode reader functions

GetpalletScan==> single barcode capture

ClearCollect(GetPalletScan,{PalletBarcode: First(BarcodeReader1.Barcodes).Value})

And

GetPartScan==> multiple barcode capture

ClearCollect(GetPartScan,{PartsBarcodes: BarcodeReader2.Barcodes.Value})

 

this part works ok, and i can see the values being captured in textlabels\galery, but them i have a SUBMIT button that tries a Forall and patch to insert all records and it keeps failing or throwing errors:

 

onselect:

 

ForAll(
GetPartScan,
Patch(
'Pallet Tracker',
Defaults('Pallet Tracker'),
{
PalletNumber:First(GetPalletScan).PalletBarcode,
PalletContent:PartsBarcodes
}
)
)
;
Clear(GetPalletScan);
Clear(GetPartScan)

 

And this keeps throwing errors like : 

Issue
The type of this argument 'PalletContent' does not match the expected type 'Text'. Found type 'Table'.
 
And i cant figure out what i'm doing wrong. 
Any help would be much appreciated.
 
 
Categories:
I have the same question (0)
  • JasonZF Profile Picture
    572 on at
    PalletContent:PartsBarcodes

    That line is trying to place the entire table into the PalletContent field. Since you are iterating through each record of the collection GetPartScan, you should reference ThisRecord.

     

    ForAll(
    GetPartScan,
    Patch(
    'Pallet Tracker',
    Defaults('Pallet Tracker'),
    {
    PalletNumber:First(GetPalletScan).PalletBarcode,
    PalletContent:ThisRecord.PartsBarcodes // This line was changed
    }
    )
    )
    ;
    Clear(GetPalletScan);
    Clear(GetPartScan)
  • Community Power Platform Member Profile Picture
    on at

    Hey @JasonWS , thanks for your time and answer.

    it keeps throwing the Table error when expecting text.

    i Do want to execute a sort of "bulk insert" so that the different values of PartsBarcodes have all the same value of Palletbarcode.

  • Verified answer
    JasonZF Profile Picture
    572 on at

    I think I figured it out. The issue is with your collection of the part number barcodes. You want each captured part number to occupy a record within your GetPartScan collection, correct? As it is now, you are grabbing a single-column table and placing it within a single record in the collection, so it's essentially a table within a table. Change your second barcode formula from this:

     

    ClearCollect(
     GetPartScan,
     {PartsBarcodes: BarcodeReader2.Barcodes.Value}
    )

     

    to this:

     

    Clear(GetPartScan);
    ForAll(
     BarcodeReader2.Barcodes,
     Collect(
     GetPartScan,
     {
     PartsBarcodes: ThisRecord.Value
     }
     )
    )

     

    Now this collection will contain a column called "PartsBarcodes" containing all of the part numbers. My original suggestion of using ThisRecord.PartsBarcodes should work.

     

    EDIT:

    Here's how it looks with your code. You can see the nested table.

    JasonWS_0-1683813806040.png

    Here's how it looks after my suggestion:

    JasonWS_1-1683813875335.png

     

     

  • Community Power Platform Member Profile Picture
    on at

    @JasonWS that's it, thank you for your time and patience.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard