while getting the multiple sysid from system property returning undefined in script include

krishna761
Tera Contributor

Hi,

 

while getting the multiple sysid's from system property returning undefined in logs from script include.

system property is given in comma separated value.

ex: bbdcc1cd97c6a253afc8,fd0d8141907aa253afb4,7e4dc54597b253af37,4er5ty678793rdf36

var SDgroups = gs.getProperty('ITSM_SD_Groups');
gs.log(SDgroups);
result from log: undefined
 
So i need to use this sysid's to  glideRecord 'sys_user_grmember' table.
Please help me on this.
7 REPLIES 7

Hi Viswas,

Thanks for quick response.

still i am getting the undefined

 

var getGrp = gs.getProperty('ITSM_SD_Groups');
var spl = getGrp.split(',');
gs.log(spl);
for (var i = 0; i < spl.length; i++){
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('group',spl[i]);
gr.query();
gs.log('@@@.....'+spl[i]);
while(gr.next()){
gs.print(gr.user.getDisplayValue());
}
}
 
it is not going to the loop. In logs it getting undefiend.

Please attach your property and written code with logs..

Isaac Vicentini
Mega Sage
Mega Sage

Hi @krishna761!

 

The sys_properties record has the fields "Suffix" and "Name", you must ensure that you are using the value of "Name" field in gs.getProperty().

 

Example:

 

IsaacVicentini_0-1726755988693.png

 


Best regards,

Isaac Vicentini
MVP 2025


If my answer was helpful, mark it as Helpful or Accept as Solution.