The CreatorCon Call for Content is officially open! Get started here.

Add file downloadable link in UI page from sys_attachment

singhajeet
Tera Contributor

How to add file downloadable links in UI pages from sys_attachment table.

I have tried a few options and putting anchor  value in the href like below

https://instance-name.com/ui_page.do?sys_id=12c0286a1b7161106c1aa86fe54bcb54

I am getting errors like 

Requested attachment does not exist

Even file is there I can able to download it from the sys_attchment table

@Ankur Bawiskar, Please help me on the same.

10 REPLIES 10

@singhajeet 

where you want to show this UI page to users?

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

Hi @Ankur Bawiskar ,

 

UI pages can be used by internal users only. We have to create html form where I have to fetch the sys_id and filename from the sys_attachment table by user id and then I have to add the respected value into a tag like this- <a href="https://instance-name.com/sys_attachment.do?sys_id=12c0286a1b7161106c1aa86fe54bcb54">file_name</a>.

 

Hope I am able to explain you šŸ™‚ 

 

Thanks

Ajeet

@singhajeet 

Still I am not clear where you want to show this link to user?

Do you want to show it on catalog form during submission?

What's the screen ?

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

@Ankur Bawiskar 

Just want to create a UI page with a sample downloadable file. Where the user can click on the link and download the file. There is no catalog and no submission is required. Assume file is exist in the sys_attachment table along with sys_id.

 

Thanks

Ajeet

 

singhajeet_0-1682404705475.png

 

@singhajeet 

how will end user navigation to this screen?

is it via email body which they receive?

May be I am not able to understand the business use-case here.

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