Mobile qr code scan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 02:18 AM
I have to scan the QR code on assets, including Asset Tag and Serial Number via the Agent Mobile App.
In OOTB, when I scan assets while purchase order case, it has separate scanning for Asset Tag and Serial.
How can I achieve the Asset Tag and serial number autofill after the QR code scanning?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 02:20 AM
1. Asset tag exists on both Asset and CI tables. Scanning it for Asset related workflows will work against the asset tables. Scanning it for other workflows should use the CI. The value is synced ffromt he Asset to CI and vice versa.
2. You can use OOB HAM workflows
3. Here is more info: https://docs.servicenow.com/en-US/bundle/sandiego-mobile/page/administer/tablet-mobile-ui/concept/sg...
Thanks
Abi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 09:36 PM - edited 09-06-2023 09:37 PM
Hello Abhigyan,
The QR code consists of Asset Tag and Serial Number.
My Requirement is when I scan the QR code the Asset Tag and Serial Number should be fetched in their respective fields.
But when I made the QR code scanning both the number fetched in Asset Tag field only, whereas the serial number was empty.
Can you please comment now, how can I overcome this challenge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 11:56 PM
Hi @Sarthak ,
For the above condition you need to write either a client script or before BR.
Where you need to write a split condition to split asset tag and serial number.
// Client Script to split asset tag into asset tag and serial number
(function () {
// Get the asset tag field and its value
var assetTagField = g_form.getField('asset_tag');
var assetTagValue = g_form.getValue('asset_tag');
// Check if the asset tag value contains a hyphen (assuming the format is "AssetTag-SerialNumber")
if (assetTagValue && assetTagValue.indexOf('-') !== -1) {
// Split the asset tag value into parts
var parts = assetTagValue.split('-');
// Set the asset tag and serial number fields with the split values
g_form.setValue('asset_tag', parts[0].trim()); // Set the asset tag field
g_form.setValue('serial_number', parts[1].trim()); // Set the serial number field
}
})();
Thanks
Abi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 12:39 AM