How add dynamic "sys_id" on a URL to a catalog variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 02:16 AM
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.
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!
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 02:33 AM
Hi,
how have you added the link?
I doubt you can make it dynamic
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 02:40 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 02:44 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2022 05:00 AM
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!