Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

Sandeep Rajput
Tera Patron
Tera Patron

@singhajeet Try forming your href like following.

 

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

//Here sys_id should be the sys_id of your attachment record in sys_attachment table 12c0286a1b7161106c1aa86fe54bcb54 

Hope this helps.

Hi Sandeep, 

 

Thanks for your valuable response!

I already tried that with sys_id of the attachment table, but not working.

 

Thanks

Ajeet

Ankur Bawiskar
Tera Patron
Tera Patron

@singhajeet 

What's your business requirement here?

where is that file stored?

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

Hi Ankur,

 

The business requirement is - We have to add a file downloadable link on the UI page and the file is stored in the sys_attachment table.

 

I have tried with the sys_id of the sys_attachment table but getting errors like request attachment is not find  - https://instance-name.com/sys_attachment.do?sys_id=12c0286a1b7161106c1aa86fe54bcb54

 

Regards!

Ajeet