How do I implement the barcode scanning feature on a UI page?

jimbendoraitis
Kilo Contributor

I am working on a new application that is meant for updating existing asset information. The hardware assets in mind have barcode serial numbers that are used to identify the item, and I want the application to utilize the barcode attribute functionality that is part of the string field for a typical form in order to lookup the asset by serial number.

Basically select the stockroom, scan the asset, and have its state update.

I know how to use the barcode attribute on a form field, and if I can get the input I know how I will do the update on the server script; however, I am cannot figure out how I might get the scanner input function on a mobile UI page.

How might I go about adding in the input field on the HTML UI page, which utilizes this module?

I have looked at jelly syntax extensions, but they don't seem to be the correct route. It seems other posts on the community have mentioned using this kind of a feature, but I haven't seem any explanations as to how.

Thank you in advance!

1 ACCEPTED SOLUTION

srinivas007
ServiceNow Employee
ServiceNow Employee

Hi jimbendoraitis,

there is already an api named cabrillo, which you can use for this purpose. It is very simply to use. There is a method cabrillo.camera.getBarcode() in the api which serves your purpose. You can find information on how to use it here. Feel free to ask any queries regarding this.

 

Thanks,

Srinivas.

View solution in original post

6 REPLIES 6

Hi Leonard, 

Im trying to put together a POC for integrating a scanner page to input into and search records. I see from the github comments you were able to get it working from the K17 lab. Does this facilitate scanning a barcode and referencing against the asset table for managing assets ?

mdjoseph12
Giga Contributor

Hi jimbendoraitis - Can you share with me how you implemented the barcode attribute on a form field?