How to call script include from System Property?

petr_jaros
Kilo Contributor

Hi, I have a problem. I have to find using script include groups with specific role, which I have done. But now I have to store the values that script include will return in array and store them using System Property. And I do not know how to call script include from system property and store the values there.  Thanks for suggestions

System Property

find_real_file.png

Script Include

find_real_file.png

2 REPLIES 2

Anil Lande
Kilo Patron

Hi,

The approach you are using to get group with particular role is not correct. System property hold a constant value and you cannot call script include in the system property.

Anyway if you have a Script Include function to get the array of groups with particular role then you don't need system property. You can call the script include function in almost all configurations elements of ServiceNow. 

I would suggest to use same function in your script and avoid using property if your group array is going to change frequently. 

 

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I believe you wan this

1) system property should hold group sys_ids as comma separated

sys_id1,sys_id2

2) now in script include after line 6 add this

sysGR.addQuery('group.sys_id', 'IN', gs.getProperty('propertyName'));

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader