How to add an attachment functionality in a service portal page?

joanmarisse
Tera Expert

I have this page to record data and I want to add an attachment functionality where users can add attachment in service portal.

Do you have an idea how to do it?

Please advise.

Thanks!

40 REPLIES 40

Govinda Reddy1
Giga Expert

Hi Joan,



Use UI Macro to get this functionality by paper clip icon




<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<html>


<body>


<div id = 'attach'><span style="cursor:pointer"><img src="attach.jpgx" onclick="saveCatAttachment(gel('sysparm_item_guid').value, '$[item_table]')"/> <font face="calibri" color="black" onclick="saveCatAttachment(gel('sysparm_item_guid').value, '$[item_table]')">Attach File</font></span></div>


</body>


</html>


</j:jelly>




The same functionality in UI Action.



Create an Attachment UI Action - ServiceNow Guru


Hello,



Thanks for replying.


I guess this is not applicable for a page in service portal.



Thanks!


hrshoaib06
Tera Contributor

Hi,



You can use the "Ticket Attachments" widget on your Service Portal page to add attachments. You can clone this widget to extend the default functionality.



Thanks,


Mohamed Shoaib


Hello Sir,



Good day.


Yes I have tried using it but I always get this error once I try to update:


Cannot read property 'push' of undefined



Please advise.



Thanks!