create records in custom table when record inserted in RITM table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-05-2025 01:18 AM
Hi
I have created a catalog item with a list collector variable, when i selected 10 users in list collector, in ritm record it will show the selected users.
i want to create 10 user records in custom table with RITM number as same as generated ritm record in sc_req_item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-05-2025 01:27 AM
if you are using flow then you can iterate over that list collector and then create record
something like this, but please enhance as per your requirement
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
6 hours ago
Hope you are doing good.
Did my reply answer your question?
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
6 hours ago
Hi @Rajkumar Bommal
You can script it out using loop...
(function executeRule(current, previous /*null when async*/) {
// Access the List Collector variable (replace 'u_selected_users' with your variable name)
var users = current.variables.u_selected_users;
if (users) {
var userArr = users.split(',');
for (var i = 0; i < userArr.length; i++) {
var userSysId = userArr[i].trim();
if (userSysId) {
var gr = new GlideRecord('u_ritm_users'); // custom table
gr.initialize();
gr.u_ritm = current.sys_id; // reference to RITM
gr.u_user = userSysId; // user reference
gr.u_ritm_number = current.number; // store RITM number (optional)
gr.insert();
}
}
}
})(current, previous);
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
ļ YouTube: https://www.youtube.com/@learnservicenowwithravi
ļ LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/