- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2024 01:04 AM
Hi All,
We are receiving multiple sys_id from the recordsIds but the code is not working properly
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2024 08:00 AM
Thank you for marking my response as helpful.
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
11-28-2024 06:12 AM
is this an array? if yes then do this
var recordIds = input.controller;
gs.addInfoMessage('test' + recordIds);
for (var i in recordIds) {
var tag = getTags(recordIds[i]);
gs.addInfoMessage(tag);
}
function getTags(recordId) {
var grInt = new GlideRecord('interaction');
grInt.addQuery('sys_id', recordId);
grInt.query();
while (grInt.next()) {
var grshort_description = grInt.short_description;
var grReason = new GlideRecord('wu_m2m_location_queue_reason');
grReason.addQuery('wu_reason.reason', grshort_description);
grReason.query();
if (grReason.next()) {
var grLabel = new GlideRecord('label_entry');
grLabel.addQuery('table_key', grReason.sys_id);
grLabel.query();
if (grLabel.next()) {
var grTag = grLabel.label.getDisplayValue();
gs.addInfoMessage('test_123' + grTag);
return grTag;
}
}
}
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
11-28-2024 08:00 AM
Thank you for marking my response as helpful.
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