How do I include attachments when I publish my app to the Application Repository?

RobS91530840614
Tera Contributor

I'm having trouble including attachments in my application. So for example, I want to use a .ico file in my UI Page. I add it as an attachment and then set up my code like below with its sys_id. This works great in my dev instance.

  <head>
    <link rel="shortcut icon" href="/sys_attachment.do?sys_id=abcdefghijk1234567890dedcfe16d4313"></link>
  </head>

 I then go to sys_attachment and make sure the file is added to my application files.
The trouble is, when I then publish to the App Repository and install on a new instance, the file size is then 0 bytes.
I then found out this is due to the way attachments store their data inside sys_attachment_doc. The problem I have is that I can't add the records inside sys_attachment_doc into my application files, the opion to Create Application File is not available.
So what is the correct way to achieve this?

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@RobS91530840614 

If you are not able to add the sys_attachment_doc then it's not possible.

When you publish the app you can provide a separate image file along with that which customers can download and have manual activity to update the sysId

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar
Is that normal for a service now application to have the user install additional files? It doesn't seem very user friendly?
Cheers,
Rob

@RobS91530840614 

there are some limitations when you publish app.

I have worked with something similar and we did share separate update set which was in global scope to our customers and inform the manual steps to perform as part of installation guide and design document.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@RobS91530840614 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader