
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 06-14-2022 04:01 PM
Create a unique QR code for the asset or any record of a ServiceNow table;-
1. Create a UI script and import the js package (jquery.qrcode.min)- UI Script name- jquery.qrcode.min
2. Create a UI page and use the UI script jquery.qrcode.min as the source.- UI page name- QRLink Page
3. Call the UI page QRLink Page from any UI action. UI Action name- Generate QR Link
XML export of UI script, UI page, and UI action have been attached. Thanks,
Regards,
Nayan
- 35,398 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Nayan Mahato
Is there a way to get the image in a variable in a business rule?
I am trying to adapt the jquery.qrcode.min code to one script include and call it from business rule script, but I am not able to get the image (I need it in base64).
Any idea?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@InakiMunoz Wait a sec? Both business rules and script includes are SERVER side. You cannot use jquery on the server. What exactly are you trying to achieve?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@SaschaWildgrube i'm trying to create an script include based in the jquery code that i can call from a business rule. I really don't know if that's possible.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
hey @SaschaWildgrube I need to create a QR code and store it on the record. I'm wondering if its possible to keep it in Image type field, or maybe some other type, what do you think? The best scenario for me is to create some UI Action with "Generate QR Code" and then keep this code in this new custom field. Any sugestions on that subject?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Why would you store a QR code image with a record? QR code are usually printed in some form or another to be found and scanned in the real world?
The use case I had to solve was to create shipping labels which were printed and attached to packages that were moved from Germany to Ukraine in the first months of the full scale invasion.
The labels contained QR codes that would lead to a specific UI page on which the user could register where the package currently is.
To integrate the QR code into a PDF I rendered the QR Code as a html table with black and white cells and then transformed the html footprint into PDF using OOTB apis.
At this time, I also tried to store an BMP image file as an attachment to the record, but that didn't work since I could not store the binary stream into an attachment (the OOTB API would always perform some kind of weird conversion of what it assumed to be characters) so generating a BMP file and store it as an attachment did not work. But maybe that "feature" of the attachment API has been modified since then.
The result of my work is all contained in the DevTools app:
https://www.wildgrube.com/servicenow-devtools
- « Previous
-
- 1
- 2
- Next »