cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jwwalker
Helper I
Helper I

Barcode Scanner

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?)

1 ACCEPTED SOLUTION

Accepted Solutions

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

 

View solution in original post

15 REPLIES 15
MrNappa
Advocate V
Advocate V

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.

😞 didnt work

v-siky-msft
Community Support
Community Support

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

 

@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.

@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
Frequent Visitor

Try this:

 

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

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

 

View solution in original post

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. 

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,618)