Generating URL dynamically
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 11:56 AM
In email , i want to provide a dynamic URL based on loggedin user.
URL: Instance name/sp?id=pagename&instanceid=abc12345
Above link i want to pass it in the email, but here the issue is instance id needs to be based on loggedin user, but here as user clicking on link in email, we cant get the loggedin user details right?
Can someone help me on this to move forward on this issue?
Thanks in advance,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 12:41 PM
Hi @Sandeep Kumar13,
If you are using the logged-in user's sys_id within the instanceid parameter, you can use something like:
/sp?id=pagename&instanceid=javascript:gs.getUserID()
Cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 01:14 PM - edited 06-11-2024 01:15 PM
Hello @Sandeep Kumar13 ,
You can configure a System Notification > Notification Email Script to generate the URL based on logged-in users.
To provide a more specific solution, could you please provide more details? Please explain your entire requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 08:19 PM
you can have email script and check the logged in user's sysId
how are you identifying the instanceid for each user? are you storing that on user record?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2024 11:33 PM - edited 06-11-2024 11:35 PM
Hi @Ankur Bawiskar @PrasadS
Here for survey ,we are assigning survey to some xyz users.
When you check in survey instances, these users are there.
So we are going to publish this by giving them link like 'click here ' to take survey.
My query is how to send different different instance id's to different users in 'Click here 'URL only .