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 / Scan QR Code to Popula...
Power Apps
Answered

Scan QR Code to Populate Multiple Repeating Fields

(0) ShareShare
ReportReport
Posted on by 22

Hi, 

 

I am building a warehousing app where I would like to give users the option to Scan one QR containing 50 products, split into multiple fields. 

 

The fields are: Product Description, Pallet Number and Pallet Quantity. 

 

Currently I do a split scan on a QR code for one product, which separates the three fields above by ";" (e.g., Description;Pallet Number;QTY). My datasource is a SP List, however open to suggestions if something else is better. 

The syntax I use currently use on the scanner button is: 

ClearCollect(SplitScan,Split(BarcodeScanner6_3.Value, ";"));Form1_5.Updates;SubmitForm(Form1_5);

And on each data card I'm using: 

Last(FirstN(SplitScan,1)).Result (and so fourth)


I would like to build in a bulk scan option, where a user can scan one QR code and that populates the SP List with say, 50 products. 

 

In this scenario, suppose my QR Code is:

Description,123456-1,500;Description,123456-2,500;Description,123456-3,500;Description,123456-4,500;Description,123456-5,500;Description,123456-6,500;Description,123456-7,500;Description,123456-8,500;Description,123456-9,500;Description,123456-10,500;Description,123457-2,300;Description,123457-3,300;Description,123458-50,475;Description,123458-51,475;Description,123458-52,475;Description,123458-53,475;Description,123458-53,475;Description,123458-54,475;Description,123458-55,475;

 

How could I do one scan on the code above, but submit as multiple entries in the SP list? I am bamboozled. 

 

Thanks 🙂 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,740 Most Valuable Professional on at

    Hi @Zachera ,

    Yes, a brain-toaster indeed . . . this will get you a collection with your values - so confirm that first

    With(
     {
     wRecord: 
     Split(
     YourScannedCode,
     ";"
     )
     },
     With(
     {
     wFields: 
     ForAll(
     wRecord As aRecord,
     With(
     {
     wSplit: 
     Split(
     aRecord.Result,
     ","
     ).Result
     },
     {
     'Product Description': First(wSplit).Result,
     'Pallet Number': Index(wSplit, 2).Result,
     'Pallet Quantity': Last(wSplit).Result
     }
     )
     )
     },
     ClearCollect(
     colYourCol,
     wFields
     )
     )
    )

    Your Patch (as new records) would be something like this (I have assumed the same field names in your List)

    With(
     {
     wRecord: 
     Split(
     YourScannedCode,
     ";"
     )
     },
     With(
     {
     wFields: 
     ForAll(
     wRecord As aRecord,
     With(
     {
     wSplit: 
     Split(
     aRecord.Result,
     ","
     ).Result
     },
     {
     'Product Description': First(wSplit).Result,
     'Pallet Number': Index(wSplit, 2).Result,
     'Pallet Quantity': Last(wSplit).Result
     }
     )
     )
     },
     ForAll(
     wFields As aPatch,
     Patch(
     SPListName,
     {
     'Product Description': aPatch.'Product Description',
     'Pallet Number': aPatch.'Pallet Number',
     'Pallet Quantity': Value(aPatch.'Pallet Quantity')
     }
     )		
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Zachera Profile Picture
    22 on at

    Hi @WarrenBelz , thank you for your help on this one.
    Great news,the first code you listed worked, where everything saves in a local collection on my device.
    However I can't get the patch to work without a bunch of errors however. It may be simply my lack of understanding around the With/For All/Patch functionality. 

    Please assist. 

     

    Thank you

     

  • WarrenBelz Profile Picture
    156,740 Most Valuable Professional on at

    @Zachera ,

    I have modified it in my post. This works on a test list here with the same field names.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Zachera Profile Picture
    22 on at

    @WarrenBelz 

    I must be doing something incorrectly. My syntax below is still coming up with 11 errors (Unexpected characters, function 'ForAll' having invalid arguments etc.). I have written this as shown in my SP List (have tried changing the column names as per what they show up as on the backend of sharepoint when you hover over the hyperlink too and the errors don't disappear). 

     

    With(
     {
     wRecord: 
     Split(
     BarcodeScanner6_3,
     ";"
     )
     },
     With(
     {
     wFields: 
     ForAll(
     wRecord As aRecord,
     With(
     {
     wSplit: 
     Split(
     aRecord.Result,
     ","
     ).Result
     },
     {
     'Product': First(wSplit).Result,
     'Pallet ID': Index(wSplit, 2).Result,
     'Quantity Scanned': Last(wSplit).Result
     }
     )
     )
     },
     ForAll(
     wFields As aPatch,
     Patch(
     'Barcode Database Test'
     {
     'Product': aPatch. 'Product',
     'Pallet ID': aPatch. 'Pallet ID',
     'Quantity Scanned': Value(aPatch. 'Quantity Scanned')
     }
     )		
     )
     )
    )
  • WarrenBelz Profile Picture
    156,740 Most Valuable Professional on at

    @Zachera ,

    You are missing a comma - please relook at my code, I am sure you will spot it.

  • Zachera Profile Picture
    22 on at

     

    @WarrenBelz 


    Spotted the comma - I think I was looking at it for too long yesterday. I appreciate your help and patience.

    Merry Christmas and happy holidays 🙂 

     

    Cheers,

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard