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 Apps
Answered

Barcode Scanner

(0) ShareShare
ReportReport
Posted on by 39

Hi,

 

Building a simple Barcode Scanner and i need help figuring out a code. I have one scan button and one label to show the scan info to verify i scanned the right barcode. now i have captured the info and need to get that info from that label to my sharepoint list. Any ideas on how to code that. I'm thinking a (?A send button attached to the label of info that patches it to sharepoint?)

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

    Depends on what do you want to do with the scanned value. Do you want to use it to search in a sharepoint list? Or add the scanned value to the sharepoint list?

     

    In the latter case, you could, for example, add a 'Send value' button, with code something like:

    If( !IsBlank( BarcodeScanner1.Value ),
     Patch( 'My sharepoint list', Defaults( 'My sharepoint list' ), { 'Scanned value': BarcodeScanner1.Value } );
     Reset( BarcodeScanner1 );
    )

    That's the basic idea.

  • jwwalker Profile Picture
    39 on at

    😞 didnt work

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

    Hi @jwwalker 

    Could you please share more about your scenario? Which column and record do you want to save the barcode value to?

    1. Create a Text column, e.g "BarcodeValue", in the SP list to store the barcode value if there is not.

    2. If you want to save the barcode value to an existing record, for example, the first record, please set OnSelect of Button as below

     

    Patch( 'SP list', First( 'SP list' ), { BarcodeValue: BarcodeScanner1.Value } )

     

    3. If you want to save the barcode value to a new record, please set OnSelect of Button as below

     

    Patch( 'SP list', Defaults( 'SP list' ), {Title:"Test", BarcodeValue: BarcodeScanner1.Value } ) // In general, Title is the required columns

     

    Hope this helps. Please feel free to post back if there is any question.

    Sik

     

  • jwwalker Profile Picture
    39 on at

    @v-siky-msft On screen1 I have added a barcode scanner with a label to show the value of scanValue. Label is used to verify i scanned the correct barcode. Then i have a button above the label and i want the value of the verified label to be sent to sharepoint via this button.... ??? not sure how to get that value from the label to the button when i push the button.

  • jwwalker Profile Picture
    39 on at

    @v-siky-msft 

    ::Button::(Receive Label value and send to sharepoint upon verification of correct barcode was scanned)

    ::Label::(To hold scanvalue and verify correct barcode was scannned)

    ::Scan::(To scan barcode)

  • ulisesrc75 Profile Picture
    10 on at

    Try this:

     

    Patch(
    DB_Name,
    Defaults(DB_Name),
    {
    Item01Fecha: Text(
    Now(),
    DateTimeFormat.ShortDate
    ),
    Item02: 
    Item03:
    Item04: 
    Item05:
    Item05l:
    }
    );

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @jwwalker 

    So you want to save the label Text to Sharepoint, right?

    Please try this if you want to save the Label Text to a new row. Reference: Patch function 

    Set the following codes to OnSelect property of Button.

     

    Patch( 'SP list', Defaults( 'SP list' ), {Title:"Test", 'Barcode Value': Label1.Text } ) 

     

    Note: replace 'Barcode Value' by your own Text column name of the SharePoint list.
    Sik

     

  • jwwalker Profile Picture
    39 on at

    This is what i am trying to achieve. Itried the fx you gave me, but no worky 😞

     

    Barcode scanner fx: OnScan-fx-Set(scanValue, BarcodeScanner6.Value)

    Label fx: Text-fx-scanValue

    Send to Sharepoint Button fx:  Patch( 'Laptop Service Tag(S/N)', Defaults('Laptop Service Tag(S/N)'), {Title:"BarcodeScanned", 'BarcodeScanned': Label4.Text, Who: User().FullName, When: Now()}); Reset(Label4.Text); 

     

     

    The Send to sharepoint button is the only broken piece. Getting errors. 

  • jwwalker Profile Picture
    39 on at

    Here is a screenshot attached. sry. new to this.

  • jwwalker Profile Picture
    39 on at

    Barcode Scanner snip.png

     

    Blue button sends value to label, i need the green button to pull the value from label and send to sharepoint.

    I have sharepoint attached to my green button.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard