- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 10:08 AM
Hello Reader,
I am trying to pass a URL from Server Script to the HTML content, but there seems some issue with the syntax. Here in my code, please suggest me a solution for the same.
HTML:
<a ng-href="{{data.link1}}">Download Diving License</a>
SERVER SCRIPT:
data.divinglicense = gr.getValue('x_87405_dive_man_0_license_image');
data.link1 = "https://dev12345.service-now.com/sys_attachment.do?sys_id="+data.divinglicense;
Here I am getting sys_id of the attachment from GlideRecord and using it to form a URL. But this is not working.
Kindly suggest.
Thanks
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 10:42 AM
when you click on the what is happening exactly ?
is it taking you to new tab and then auto closing the tab with in a second ?or it takes you to new tab and stays in the new tab with URL constructed with the attachment sys_id?
HTML
<a href={{data.link1}} target="_blank">Download Diving License</a>
Server script:
data.divinglicense = gr.getValue('x_87405_dive_man_0_license_image');
data.link1 = "https://dev12345.service-now.com/sys_attachment.do?sys_id="+data.divinglicense.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 10:18 AM
hello
Are you sure its the attachment sys_id?
you are trying to get the value of the attachment name I guess instead directly get the sys_id by querying with name
CAN YOU CONFIRM ON THIS ?
and also You need not use ng-href you can just use href and try !
Please use href and let me know
Please mark my answer if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 10:30 AM
Hello Mohith,
Thank you for the response.
Yes, It is sys_id of the attachment record. This is for sure.
Can you please provide syntax? I have tried it from end, but not being to achieve it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 10:42 AM
when you click on the what is happening exactly ?
is it taking you to new tab and then auto closing the tab with in a second ?or it takes you to new tab and stays in the new tab with URL constructed with the attachment sys_id?
HTML
<a href={{data.link1}} target="_blank">Download Diving License</a>
Server script:
data.divinglicense = gr.getValue('x_87405_dive_man_0_license_image');
data.link1 = "https://dev12345.service-now.com/sys_attachment.do?sys_id="+data.divinglicense.toString();