Add hyperlink to form and open excel file on clicking it

Servicenow Use4
Kilo Guru

Hello All,

I have an excel file. I need to have a hyperlink in the form. On clicking that hyperlink, that excel file should be opened. I searched on community and found varying answers related to this but couldn't get a clear idea as to what has to be done....

Can anyone throw some light on

1. how to add hyperlink to a form

2. On its click, open an excel file.... please note.. i just want it to get opened..and not save the file.

 

Many thanks in advance!

 

1 ACCEPTED SOLUTION

Hi,

For point 1 - if you want that file to be shown via URL then you need to store it in ServiceNow i.e. attach to some or other table record.

For point 2 - it depends on the browser configuration whether it is set auto-download or only Open

what type of form you are trying to show to user?

Regards
Ankur

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

View solution in original post

15 REPLIES 15

Hi!

Thanks for the suggestion. I think I'm close to finding a solution.

Here's what I did, I chose field type as URL and saved. On the form, right-click on this field...choose 'Configure Label'. In the 'URL' field I entered google's link and saved. Came back to the form and clicked on the hyperlink and google.com opened. Bravo!

Now, just that no one should change this link, I made it read-only. and tested. The hyperlink is still clickable and google.com opens.

 

I just need to find a way to upload the excel sheet in my servicenow instance. and then give its link in the 'URL' field.

Let me know if you have any ideas, please.

Hi,

As mentioned earlier you will have to store the file on some record without which it won't come as attachment to any record.

please check the point I mentioned in my previous comment if that helps.

Regards
Ankur

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

Hello Ankur, 

Thanks for the suggestion. I was trying to add the document to one of the tables so that it gets reflected in the sys_attachment table, but couldn't do so. Although I am aware that it is the correct approach.

Hence, as a workaround, I added the files to Teams and provided that link to the URL field and it worked.

 

Many thanks for all the assistance..!

Best Regards!

ServiceNow User

@Servicenow User 

Glad to know.

Feel free to close the thread by marking appropriate answer as correct & helpful to close the thread.

Regards
Ankur

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

Yash Agrawal1
Tera Guru

Hello,

Let's suppose you have a text "Click Here" and on clicking of that you need to redirect to a excel file,which is stored on s Drive/or anywhere or internet.

used the below code

[code]<a href="http://www.google.com">ServiceNow.com</a>[/code]

Instead of "http://www.google.com" replace it with you link where you stored your excel file

This will help you

Please Mark it helpful/correct if my answer helps in any way to resolve
your query.
Reach out to me if any more help required.

Regards

Yash.K.Agrawal