How to set URL in href tag dynamically in Service Portal

shaik_irfan
Tera Guru

Hi,

 

I am working on Service Portal i am getting the URL in Server Side script, how to set that in html field to set dynamically.

 

Example:

 

In Server side script i get the URL

gs.log(result.webUrl,"url");
result.url = result.webUrl;

 

How to call that url in HTML to work onclick of that record.

<a ng-href= "{{result.url}}" target="_blank" class="h4 text-primary m-b-sm block">

 

Above line is not working, if i hard code the url then it is working

 

<a ng-href= "www.google.com" target="_blank" class="h4 text-primary m-b-sm block">

 

1 ACCEPTED SOLUTION

Hi Irfan,

 

If it is on Search Sources portal you need call using 'item' as shown below

 

<a ng-href= "item.url" target="_blank" class="h4 text-primary m-b-sm block">

 

assuming your url is  in result.url

 

 Please Refer

 

 

Please mark it as helpful or correct based on the impact

Regards,

Abdul Azeez

 

 

View solution in original post

3 REPLIES 3

johansec
Tera Guru

set the url to a scoped variable 

In the server script data.url

Or 

In the client script c.url 

 

 

Then put it in the html

If you used the server variable

<a ng-href= "{{c.data.url}}" target="_blank" class="h4 text-primary m-b-sm block">

 

Or 

If you used the client var

<a ng-href= "{{c.url}}" target="_blank" class="h4 text-primary m-b-sm block">

My script is in server side script written in data fetch script under search sources in portals

Hi Irfan,

 

If it is on Search Sources portal you need call using 'item' as shown below

 

<a ng-href= "item.url" target="_blank" class="h4 text-primary m-b-sm block">

 

assuming your url is  in result.url

 

 Please Refer

 

 

Please mark it as helpful or correct based on the impact

Regards,

Abdul Azeez