How to save a QR Code to an image field via a script

Community Alums
Not applicable

Hi All,

I have implemented the project from the ServiceNow share at the below link and am able to create a QR code that behaves as I need it to:

https://developer.servicenow.com/app.do#!/share/contents/5194766_task_qr_code?v=1&t=PRODUCT_DETAILS

However, my full requirement is to create a QR code upon creation of a record and save that code to an image field on said record automatically.

The above project utilises a UI action to trigger the creation and a UI page to display the resulting QR Code, however, despite some extensive digging, I have been unable to find a way to find a way to create the image and save it to an image field automatically, for instance, using a Business Rule .

If anyone could assist me and/or point me in the right direction, it would be much appreciated.

Many Thanks,

Jason

 

9 REPLIES 9

Naveen20
ServiceNow Employee
ServiceNow Employee

I have tried the project by committing the update set and it is working fine on my local. The code is just using the jquery qrcode to generate the QR code.

Harsh Vardhan
Giga Patron

you can convert the file into image type on your ui page script. and then in UI Page client script you can set that image into the  image type field. 

 

use the below link for reference. 

 

https://stackoverflow.com/questions/18207328/how-can-i-save-a-qrcode-image

Community Alums
Not applicable

Hi Harshvardhan/Naveen, 

Thanks for your input, and apologies, I should have been clearer!

What I am really trying to achieve is for the QR code to be generated and added to the record in an image field automatically.

So ideally, I wouldn't use a UI Page or UI Action.

I would envisage a Business Rule triggering on Insert calling the UI script from the above mentioned project to generate the QR Code and then saving the file to the image field on the newly created record, but I've been unable to find a way to do this as yet!

I've amended the original post to a more accurate description.

Thanks again,

Jason

Hello Jason,

Did you find any solution to save the QR code as an Image?

 

Thanks,
Faizeal.