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 / MultiBarcode Reader (P...
Power Apps
Unanswered

MultiBarcode Reader (Patch & LookUp Issue)

(0) ShareShare
ReportReport
Posted on by 12

Issue 1: Patch data inside a Gallery & DropDown List + Textbox Outside Gallery

I created an Barcode Reader App to Collect Multiple Barcodes and TimeStamp in one go.
I would then manually select the dropdown Fruit and Input a Free Text to upload to a SharePoint List.
Barcode # and TimeStamp gets uploaded however the Dropdown Selection is NOT uploaded.

App View

baiocchi87_1-1689920978329.png

 

Data List

baiocchi87_2-1689921038647.png

 

 

//App OnStart code
ClearCollect(MultiBarcode, Blank())

//Insert a Gallery,Title & Subtitle
MultiBarcode

//Title2 code
ThisItem.Value

//Subtitle2 code
Now()

//Insert a BarcodeReader, OnScan code
Collect(MultiBarcode,BarcodeReader1.Barcodes)

//Add link to database 'Barcode List'
//Insert a button, rename as Submit
ForAll(MultiBarcode,Patch('Barcode List',Defaults('Barcode List'),{Title:Value,TimeStamp: Now(),CompanyName: CompName1}))

 

 

Issue 2: If value exist in List then Patch Column OnLoan
I duplicated the above code (excluding the dropdown portion) to another screen.
I want to scan similar barcodes again and if barcode value already exist inside the 'Barcode List' Title Sharepoint then Update the 'Barcode List' OnLoan Column.

 

//Check if Barcode Scanned exist in 'Barcode List'Title, if yes then Patch OnLoan
ForAll(MultiBarcode As M, With({wItem:LookUp('Barcode List',Title=M.Value)},Patch('Barcode List',Defaults('Barcode List'),{Title:M.Value, TimeStamp:Now(), OnLoan: "Yes"})))

 

 I tested above code it just create another entry in the list and does not update the existing entry. (last entry inside the attached table above)

Categories:
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @baiocchi87 ,

     

    May I ask What type of the field of Company? Is it Text or Choice?

    Let us assume it is Text for now.

     

    According to your issue. Please try formula below.

     

    Issue 1:

    //Add link to database 'Barcode List'
    //Insert a button, rename as Submit
    ForAll(MultiBarcode,Patch('Barcode List',Defaults('Barcode List'),{Title:Value,TimeStamp: Now(),CompanyName: CompName1.Selected.Value}))

     

    Issue 2:

    //Check if Barcode Scanned exist in 'Barcode List'Title, if yes then Patch OnLoan
    ForAll(MultiBarcode As M,Patch('Barcode List',Lookup('Barcode List',M.Value = Title),{OnLoan: "Yes"}))

     

    Hope this will help you,

    Best Regards,
    Tina

  • baiocchi87 Profile Picture
    12 on at

    @v-hanytian-msft , its in text format
    Both the solution codes provided is showing a code formula error.
    My guess is this is related to the usage of the below code

    Collect(MultiBarcode,BarcodeReader1.Barcodes)

     I noticed upon using this code, all .Value, .Selected, .SelectedText will error and not work

  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    HI @baiocchi87 ,

     

    Please try this:

     

    ClearCollect(MultiBarcode,Blank());
    ForAll(BarcodeReader1.Barcodes,Collect(MultiBarcode,ThisItem.Value))

     

    Hope this will help you,

    Best Regards,
    Tina

  • baiocchi87 Profile Picture
    12 on at

    sorry i don't really understand where this code should go to and how does this address my issue

  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @baiocchi87 ,

     

    May I ask have you checked the data source of the MutiBarcode?

    vhanytianmsft_0-1689926718426.png

    vhanytianmsft_1-1689926740510.png

    Is it like this?

    vhanytianmsft_2-1689926786611.png

     If Yes, the formula you doubt before is not error.

     

    May I ask the error information of the Formula?

     

    Best Regards,
    Tina

  • baiocchi87 Profile Picture
    12 on at

    baiocchi87_0-1689988411711.pngbaiocchi87_1-1689988458848.png

    ForAll(MultiBarcode As M,Patch('Barcode List',Lookup('Barcode List',M.Value = Title),{OnLoan: "Yes"}))

     

    Error message for the above code as shown is snapshot. I've checked the collection looks to be fine.

     

  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @baiocchi87 ,

    In fact, there may be times when there may be delays in the system. We recommend that you save and publish the app, refresh your browser and see if the issue exists.

    If it exists, we recommend that you delete the wrong place and fill it in again, and the system will automatically bring up the content that needs to be filled in.

     

    Best Regards,
    Tina

  • baiocchi87 Profile Picture
    12 on at

    I have tried your method and the same error still persists.
    I have solved this issue on my own using updateif and gallery.allitem function

  • baiocchi87 Profile Picture
    12 on at

    I have another issue I am facing:

    How to stop duplicate barcode scan during scan

    Collection = MultiBarcode
    Insert a Gallery, DataSource = MultiBarcode

    Title = ThisItem.Value

     

    Insert a Barcode Reader

    OnScan = If(CountRows(Filter(MultiBarcode,Value=BarcodeReader1.Barcodes))>0,Notify("Duplicate"),
    Collect(MultiBarcode,BarcodeReader1.Barcodes))

     

    If you replicate the steps and codes above, the OnScan code will show a incompatible type comparison.
    I am unsure why this error is appearing

  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @baiocchi87 ,

    Please try this:

    OnScan = If(CountRows(Filter(MultiBarcode,Value in BarcodeReader1.Barcodes))>0,Notify("Duplicate"),
    Collect(MultiBarcode,BarcodeReader1.Barcodes))

    Hope this will help you,

    Best Regards,
    Tina

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard