Set multiple sys_id's to glide_list field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2020 10:08 AM
Hi,
I need to push multiple values to a glide list field. Currently it's only pushing one sys_id and I'm not sure how to push all values from the gliderecord record. Script below:
(function executeRule(current, previous /*null when async*/ ) {
var entList = [];
var m2moim = new GlideRecord('x_lbg_insider_risk_insider_access_lookup');
m2moim.addQuery('sys_id', current.ir_access_categorisation);
m2moim.query();
while (m2moim.next()) {
entList.push(current.getValue('sys_id'));
m2moim.u_oim_entitlements = entList.join(',');
m2moim.update();
}
})(current, previous);
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2020 04:06 PM
Haven't tested this yet but something like below.
(function executeRule(current, previous /*null when async*/ ) {
var entList = [];
var m2moim = new GlideRecord('x_lbg_insider_risk_insider_access_lookup');
m2moim.addQuery('sys_id', current.ir_access_categorisation);
m2moim.query();
while (m2moim.next()) {
entList.push(current.getValue('sys_id'));
}
m2moim.u_oim_entitlements = entList;
m2moim.update();
})(current, previous);