- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2014 01:24 PM
I am currently working on User creation via Service Catalog, it's really just an RITM that submits to our AD group and another group.
I need to submit them a GUID on the form and I figured the SYS ID would work perfectly for this... However the field is a variable and it should populate on submission though since it's a catalog item there is no way to manipulate the UI Action to get that SYS ID.
Now it doesn't HAVE to be the SYS ID of the RITM being filled out, but it needs to be unique every time. I figure a 16 or 32 character MD5 will do the trick but does ServiceNow hand those out on request?
At previous companies I have just used this script, which has worked well:
http://css-tricks.com/snippets/javascript/javascript-md5/
I would just create a Script Include for it and send the MD5 back to the Client Script onSubmit. I should mention that it's not for a password, just a way for these records to come together later and recognize they are for the same person.
Should I go ahead with my method of generating an MD5 or bark up another tree?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2014 01:58 PM
You can access the sys_id it is going to use by looking at the element 'sysparm_item_guid'.
Client side, this will return the value with the prototype library that's available in SN.
$('sysparm_item_guid').getValue();
Well it's not the sys_id of the request but it's unique per page load.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2016 10:59 AM
Hi Christopher,
Could you please tell me the way to do MD5,
I need to generate unique ID in my UI page,
The below is my UI page code.
<g:evaluate var="jvar_rel1" jelly="true">
gs.getProperty('rec.id');
</g:evaluate>
<g:evaluate>
var parent_task = '${sysparm_sysID}';
</g:evaluate>
<p> <b>
<!-- <g:test_attachment_entry/> -->
<a onclick="saveAttachment('sys_data_source', '${jvar_rel1}')" ><font color="red">Manage Attachment</font></a>
<hr></hr>
<ul style="list-style-type:square">
<li><font color="MidnightBlue">Use XLS Format For Bulk Update</font></li>
<li><font color="MidnightBlue">Multiple Attachments Are Not Allowed</font></li>
<li><font color="MidnightBlue">Use Defined Template For Bulk Update</font></li>
</ul>
</b></p>
<!-- <button id="add_attachment" onclick="saveAttachment('sys_data_source', 'e8eb1e504f729200973c82818110c75c')">Upload Template</button> -->
<button id="add_attachment" onclick="saveAttachment('sys_data_source','${jvar_rel1}') ">Upload Template</button>
<button onclick="onSubmit()">Submit</button>
</j:jelly>
Right now using hardcoded sysID, by placing it in property and calling it in UI page(jvar_rel1). Am using this for attachment purpose as the saveAttachment requires two parameters (table,sysID).
It would be gratefull if you can guide me to achieve this using MD5
Thanks,
Joshwa S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2015 01:33 AM
I think what you are looking for is guid() function. It's available on client-side (tested on Dublin).