Is it possible to view the file stored in "sys_attachment" table without downloading it?

Hima Bindu1
Kilo Contributor

Hi,

We are using Report vaccination to collect the employee's vaccination details. As part of this process, they will upload their vaccine card, which will be verified by HR. Is it possible to view the attachment on the platform without downloading it?

Document Viewer plugins are installed and required system properties are set. Still not able to view the file from the sys_attachment table. Am I missing anything? Please suggest.

Thanks,

Bindu

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @Hima Bindu 

I think I have a suitable solution for you. Just configure the following UI Action:

find_real_file.png

For better copying the script code:

function openViwer() {
	var sysId = typeof rowSysId == 'undefined' ? gel('sys_uniqueValue').value : rowSysId;
	var url = new GlideURL('sys_attachment.do');
	url.addParam('view', 'true');
	url.addParam('sys_id', sysId);
	g_navigation.open(url.getURL(), '_blank');
}

After that, you will have a new item at the context menu in the list view:

find_real_file.png

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

View solution in original post

8 REPLIES 8

Hi @Hima Bindu 

no that is not possible OOTB, as you have no record view at table sys_attachment.

Kind regards
Maik

Sandeep Kumar 1
Tera Expert

Hi Hima,

 

Just tweak your URL a bit and you can see the document without downloading.

Suppose your sys_attachment record has sys_id=YourAttachmentSYSID.

Use this URL->

<yourinstance>.service-now.com/sys_attachment.do?sys_id=YourAttachmentSYSID&view=true

 

view=true when passed with the URL will allow you to see it without downloading.

 

Mark my answer correct if it resolve your query.

Regards,

Sandeep

Maik Skoddow
Tera Patron
Tera Patron

Hi @Hima Bindu 

I think I have a suitable solution for you. Just configure the following UI Action:

find_real_file.png

For better copying the script code:

function openViwer() {
	var sysId = typeof rowSysId == 'undefined' ? gel('sys_uniqueValue').value : rowSysId;
	var url = new GlideURL('sys_attachment.do');
	url.addParam('view', 'true');
	url.addParam('sys_id', sysId);
	g_navigation.open(url.getURL(), '_blank');
}

After that, you will have a new item at the context menu in the list view:

find_real_file.png

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

This is great! It worked well. Thank you, Maik.