Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to call system property inside the Record Producer script in ServiceNow

Rashmi N
Tera Contributor

Hi,

 

I have created a system property to pass the sys_id of assignment group. Now I have to call that system property inside the script of record producer. I am using below code to pass the system property inside the script, but the value is not passing.

var assignment_group = gs.getProperty('property name');

Let me know how can we bring this property inside the script.

 

Thanks,

Rashmi

2 REPLIES 2

Vishal Birajdar
Giga Sage

Hello @Rashmi N 

 

You can use it...!!!

Can you please explain the need....

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Anand Kumar P
Giga Patron

Hi @Rashmi N ,

Make sure in system property name there is no spaces property name like 

var assignment_group = gs.getProperty('property_name');
And if you are calling multiple group system ID's the you have to call like below

 var propertyValue = gs.getProperty("propertyName").split(",");
    var group1 = propertyValue[0];
    var group2 = propertyValue[1];

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand