- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 07:48 PM
Good evening!
I may be overthinking this, but I am trying to grab a variable submitted via the service catalog from the ritm, and place that value into a field located on a different table. This field resides in a custom table and is dot-walked onto the request form. I attempted a business rule utilizing the current.variables format (i.e. gr.dotwalkedfieldfromrequest = current.variables.test_variable) but realized that won't work with a dot-walked field. Should I try a glide record maybe?
any suggestions are appreciated! 🙂
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 07:58 PM
you can have after insert BR on RITM table
How is that custom table related to REQ?
You should use proper query in your GlideRecord when you query that table
Condition: current.cat_item.name == 'Your Catalog Item Name Here'
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord("yourtableName");
gr.addQuery("sys_id", 'sysIdHere');
gr.query();
if (gr.next()) {
gr.u_field = current.variables.variableName;
gr.update();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-19-2025 07:58 PM
you can have after insert BR on RITM table
How is that custom table related to REQ?
You should use proper query in your GlideRecord when you query that table
Condition: current.cat_item.name == 'Your Catalog Item Name Here'
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var gr = new GlideRecord("yourtableName");
gr.addQuery("sys_id", 'sysIdHere');
gr.query();
if (gr.next()) {
gr.u_field = current.variables.variableName;
gr.update();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-19-2025 08:28 PM
Just what I needed, thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 02:58 PM
Sorry, I have a quick follow-up question! I realized I didn't respond to your question about the relationship from the custom table to the REQ table - which I think is confusing me now (haha). I have a reference field on REQ which points to the custom table and allows me to dot-walk into the custom table fields from req. I also use this reference field within a UI policy to create a gliderecord to display the custom fields within the REQ based on the catalog item. I am trying to figure out the proper query to use from the RITM Gliderecord - do I need an additional reference field on my custom table to point to the RITM? I thought i could potentially use this but it doesn't seem to work:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2025 01:10 AM
Hi Ankur Bawiskar,
I have tried to place the RITM variable value to the REQ short description. But the value is not setting to it. I am sending my code here: