Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How add dynamic "sys_id" on a URL to a catalog variable?

velvizhisujatha
Tera Contributor

Hi Team, 

I would like to know how can I route to Service Portal using a URL embedded to a catalog variable. 

For eg. I have a preferred contact variable, where I have added a URL on that annotation part but I'm unable to route to the logged in user user profile. 

find_real_file.png

On click of the hyperlink it should route to the "sp?id=user_profile&sys_id=" only if I pass a static value I'm able to get to the user profile page. What syntax is required to make it dynamic on a variable?

Please help!

 

 

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

how have you added the link?

I doubt you can make it dynamic

Regards
Ankur

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

Hello Ankur, 

I have added it in source code in instructions under Help tag, 

<p><span style="color: red; font-size: 10.5pt; font-family: helvetica;"><strong> To change the preferred contact number: </strong></span><a style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" title="Click here" href="sp?id=user_profile&sys_id=" target="_blank" rel="noopener noreferrer nofollow"> <span style="font-size: 10.5pt; font-family: Helvetica, sans-serif; color: #113285; background: white;">Click here</span></a></p>

Will javascript:gs.getUserID() work if added next to sys_id?

Thanks!

annotation won't work in portal.

you can try that but I don't think it would evaluate to logged in user sysId

Regards
Ankur

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

Thanks for ur responses! It didn't work as u have said! I will to create a widget and add it to the variable below that. 

If possible kindly share the inputs in achieving it using widget scripting as I'm not into it much!