Generating URL dynamically

Sandeep Kumar13
Tera Guru

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?

 @Ankur Bawiskar @Mark Roethof 


Thanks in advance,

5 REPLIES 5

James Chun
Kilo Patron

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

Community Alums
Not applicable

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.

Ankur Bawiskar
Tera Patron
Tera Patron

@Sandeep Kumar13 

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?

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

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  .