- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:42 PM
We have added a new dynamic content box in the end user portal of our SNOW instance. Once the button is clicked, a link should be opened in a new window. As per the requirement, they want SNOW to pass the current logged in user's ID also along with the link. I am not aware of jelly script, so can anyone help to do this ?
We have created a dynamic content for the button with a text like "Click"
Once the user clicks on "Click", the provided link is supposed to open and the link should contain the current user'd log in ID as well. PLease help how can we include a script here to get the current user's name/ID and how can we pass that variable in the link.
The link is opening as expected in new window, but not sure how to pass the user ID. The user ID should be passed like - https://abc.com/?un={USERID}. PLease help how can we include a script here to get the current user's name/ID and how can we pass that variable in the link.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<a href="https://abc.com/?un={USERID}" target="_blank">
<div class="cms_menu_section_blocks">
<h2>Click
</h2>
<img src="ICON.pngx" />
</div>
</a>
</j:jelly>
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:49 PM
Hi,
You can try like below
<a href="https://abc.com/?un=${gs.getUserName()}" target="_blank">

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:43 PM
Hi
Try once with gs.getUserID().

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:49 PM
Hi,
You can try like below
<a href="https://abc.com/?un=${gs.getUserName()}" target="_blank">
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:50 PM
Hi,
Can you help me where to include the script and how ? And also how to use the value in the URL?
Thanks,
Krishna

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2018 11:55 PM
Hi,
You don't have to create any script.
below is the full code of whole page.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<a href="https://abc.com/?un=${gs.getUserName()}" target="_blank">
<div class="cms_menu_section_blocks">
<h2>Click
</h2>
<img src="ICON.pngx" />
</div>
</a>
</j:jelly>