how to create a button for downloading excel template

mastanbe
Tera Contributor

Hi All,

I have a requirement like  i want to create a Button for excel file download in the catalog item , how can i do this..

please help me on this requirement.

find_real_file.png

 

1 ACCEPTED SOLUTION

Hi,

you can use Rich Text variable and add button to it

1) File added to catalog item

find_real_file.png

2) Create Rich Text label variable and add source code below

HTML Source Code

<style>
a:link, a:visited {
  background-color: #f44336;
  color: white;
  padding: 14px 25px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

a:hover, a:active {
  background-color: red;
}
</style>
<p>Please download the file here:&nbsp;<a title="Link" href="/sys_attachment.do?sys_id=29c39e75073f64102011ff208c1ed04f" target="_blank" rel="noopener noreferrer nofollow">Link</a></p>

find_real_file.png

Output:

Native

find_real_file.png

Portal

find_real_file.png

Regards
Ankur

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

View solution in original post

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can task this approach

1) add excel template to catalog item

2) then use Rich Text variable to add the link

Regards
Ankur

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

Hi,

like this

1) get the sysId of sys_attachment once you add the file to catalog item and use it here

find_real_file.png

Regards
Ankur

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

Hi Ankur , 

But here i want to create a button on the form to download that attachment instead of link

Hi,

then you can add something like this

1) create widget and add button in it and add the URL of the attachment record

2) this would work in portal; add similar logic in UI page which would work in native

Regards
Ankur

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