How to open the mobile camera using script in serviceportal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-29-2018 10:59 AM
Hi,
How to open the Mobile camera to take pictures in service portal , can anyone help me in this
Regards,
Sasidhar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-17-2020 05:54 AM
Hi Janne,
I apologize for the late response but I've been a bit busy.
Instead of adding the functionality to the "addAttachment", you would probably just replace it with a custom button. (It's probably what you meant but just making sure)
I wrote this a couple of years ago so depending upon which attachment button you're thinking of switching out, the attachment button might be embedded within a widget that's displaying the form such as the new catalog widget.
In this case you could clone that widget or make a "wrapper" for that widget where you basically can do some slight manipulation of the OOB widget without cloning.
In this way you can embed your custom add attachment button.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-09-2022 10:22 PM
I use your code and created camera widget but how i can save that image into ServiceNow database table.
help me!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā04-11-2022 10:54 AM
Hi Harshal,
If you have made it to capturing the base64 encoded image one way you can attach it to a record is use the Attachment API REST service).
Or use the GlideSysAttachment API (server side only). To get the data to the server side in the widget use the .server.get() API method sending with a custom property and of course the data.
For example:
scope.take_snapshot = function(){
var snap = takeSnapshot();
scope.server.get({"snapShot": snap});
// Show image.
image.setAttribute('src', snap);
image.classList.remove("hide");
// Enable delete and save buttons
delete_photo_btn.classList.remove("hide");
download_photo_btn.classList.remove("disabled");
// Set the href attribute of the download button to the snap url.
//download_photo_btn.href = snap;
// Pause video playback of stream.
video.classList.add("hide");
video.pause();
}
Note: I haven't tested this as I don't have the setup any longer. This post was done 4 years ago.
I hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā11-01-2022 04:19 AM
Hi @ChrisBurks , we wanted to implement the solution provided by you for using camera widget. Can you please let us know how we can make this camera work as QR scanner. Is it possible?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-27-2023 10:15 PM
Can you tell me if I want that if I clicking on the UI Action Button on form after clicking the button the camera should on the it capture the live image and save to particular user record using RITM NO on Desktop