Create an attachment in a Catalog Item Before Submiting it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2025 10:06 AM
I´m creating a new catalog item that will have an html field that must show, before submitting the item, a picture.
These picture will be captured by an external integration where I will receive an Base64 content and needs to generate the attachment that will be displayed in the html field mentioned earlier.
It this requirement possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2025 05:23 AM
Yes this is possible. I would suggest an onSubmit Client Script which reads your picture payload and prevents a submit if the picture is not available/ valid.
You will have a variable or a table entry of some sort which holds your Base64 image payload. You can either check this on the client side using g_form.getValue() or on the server side using GlideAjax (note: must not be asynchronous).
function onSubmit() {
var picturePayload = '<Your Base64 content>';
if (!picturePayload) {
alert('There was an internal error, you cannot submit at this time, sorry.');
return false;
}
}
