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 / power app barcode scanner
Power Apps
Answered

power app barcode scanner

(0) ShareShare
ReportReport
Posted on by 33

hi just trying to create a barcode scanner that will allow you to update a particular column in a sharepoint list tried googling and doing some of the hints but can’t get it to work

Categories:
I have the same question (0)
  • CarlosFigueira Profile Picture
    on at

    You can have an app as simple as a single barcode scanner control, and in its 'OnScan' expression (which is executed when a barcode is scanned), use something like the Patch function to store the scanned barcode into your SharePoint list, something similar to the expression below:

    Patch(
     YourSharePointList,
     Defaults(YourSharePointList),
     { BarcodeValue: BarcodeScanner1.Value })

    Hope this helps! 

  • Dani77 Profile Picture
    33 on at

    hi tried that and it not working 

     

    the colum trying to update is title sighted i have tried referencing that in as well and not working

  • CarlosFigueira Profile Picture
    on at

    Do you get any errors? Can you clarify what is not working?

  • Dani77 Profile Picture
    33 on at

    no error message that i can see but is not updating the column 

  • CarlosFigueira Profile Picture
    on at

    You can try a couple things to see why this is not working:

    An example of the second way: you can update your expression to something like this:

    Set(valueToBeUpdated, BarcodeScanner1.Value);
    Set(
     patchResult,
     Patch(
     YourSharePointList,
     Defaults(YourSharePointList),
     { BarcodeValue: BarcodeScanner1.Value }));
    Set(
     patchResultJson,
     JSON(
     patchResult,
     JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes));
    IfError(
     patchResult,
     Set(
     possibleError,
     JSON({ kind: ErrorInfo.Kind, message: ErrorInfo.Message })))

    And have three labels in the same screen that show the result of 'valueToBeUpdated', 'patchResultJson', and 'possibleError'; that would show if any of the input or outputs have a value that are not expected.

  • Dani77 Profile Picture
    33 on at

    hi sorry i think i have confused myself now   i have tried a couple of the solutions and no luck i have attached the latest version on scan that i found in a tutorial and the column i am trying to get it to update 

     

     

    Patch(‘mylistname’, LookUp(‘mylistname’, Barcode = BarcodeScanner1.Value),{‘columnname’ : {Value:”Specific Choice Option”}})

  • CarlosFigueira Profile Picture
    on at

    I think I understand - you have a list where one column holds the barcode value, and you want to update another column of the scanned barcode... If your expression isn't working, there are a few possibilities of what could be wrong:

    1. The record that you are trying to update cannot be found
    2. The patch request itself is failing

    As I mentioned before, there are a few options to identify the problem - running the app under the Monitor, and validating that the parts of the request are valid. For example, for your expression, we can modify it as follows:

    Set(valueToBeUpdated, BarcodeScanner1.Value);
    Set(recordToBeUpdated, LookUp(‘mylistname’, Barcode = BarcodeScanner1.Value);
    Set(
     recordToBeUpdatedJson,
     JSON(
     recordToBeUpdated,
     JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes));
    Set(
     patchResult,
     Patch(
     ‘mylistname’,
     recordToBeUpdated,
     {‘columnname’ : {Value:"Specific Choice Option"}}));
    Set(
     patchResultJson,
     JSON(
     patchResult,
     JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes));
    IfError(
     patchResult,
     Set(
     possibleError,
     JSON({ kind: ErrorInfo.Kind, message: ErrorInfo.Message })))

    And add labels with the values of 'valueToBeUpdated', 'recordToBeUpdated', 'patchResultJson', and 'possibleError' that would show if any of the input or outputs have a value that are not expected

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @Dani77 ,

     

    Have you resolved the issue? 

     

    If no, what column type is that column you would like to update, Text, Choices or else like LookUp?

     

    If it is a Choices type column to be updated, please try below formula in the Button:

     

    Patch(‘mylistname’, LookUp(‘mylistname’, Barcode = BarcodeScanner1.Value),{‘columnname’ : {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value: Combobox.Selected}}) 
    //or Dropdown.Selected,depending on the Controls you are using

     

     

    If it is a LookUp  column, please try below formula:

    Patch(‘mylistname’, LookUp(‘mylistname’, Barcode = BarcodeScanner1.Value),{‘columnname’ : {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id:Gallery1.Selected.ID,
     Value:Gallery1.Selected.Title}
     }
    })

     

    In addition, as per you mentioned that you could not refer to the column by typing in function bar, please notice that any time you have modified the data source, you will need to refresh the connection in Power Apps Studio.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard