How to display "country" field value from cmn_location table in custom field of "LIST" type?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2024 08:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2024 08:37 AM
Hi @abhi710 ,
try this in Before BR
(function executeRule(current, previous /*null when async*/ ) {
var groups = current.u_groups; //0f9881b02f612010501d9bacf699b67c , b6a8cd702f612010501d9bacf699b6b1
var arr = [];
var gr = new GlideRecord('cmn_location');
gr.addQuery('nameIN'+ current.getValue("u_groups"));//change to your field name
gr.query();
while (gr.next()) {
arr.push(gr.getValue("sys_id"));
}
current.u_assignment_group = arr;// change u_assignment_group to your field name
gs.log('test u_assignment_group ' + current.u_assignment_group);//change the log statement
})(current, previous);
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2024 08:50 AM
Hi @abhi710 ,
Can you elaborate on your requirement a little more?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2024 05:23 AM
Hi @Kishor O ,
There is a custom field "Country" of type "List" on custom table, which refers to the cmn_location table. The country name should be displayed in the LIST collector from cmn_location table. How can we achieve this without changing the display value of cmn_location table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2024 08:54 AM
Hi @abhi710
From what I'm reading do you want to add country from the cmn_location which is held on a custom table? Why do you want it in a list? Surely you're location is only going to be in one country?
Thanks Andrew