using multiple sys_id in one system property value field and need to call that in Business Rule

Abhilasha G T
Tera Contributor

Hi team,

I have around 43 different sys_id's , for those need to trigger one Business Rule.

i have created one system property and given the sys_id in the value . and written one BR its working fine.

AbhilashaGT_3-1697454791854.png

 

 

AbhilashaGT_2-1697454538238.png

But i have around 43 different sys_id's  need to execute the same BR, if i put more than one sys_id in the value of system property, its not working, please suggest how can i proceed.

1 ACCEPTED SOLUTION

Ashutosh C J
Tera Guru

Hi @Abhilasha G T 
Please try this

In the property, put the SysId values with comma separator, something like this b7d2659197b5311025e49fa00153afce,b7d2659197b5311025e49fa00153afce

In the script, please use this in line 7:   wo.addQuery('template', 'IN', gs.getProperty(" your property name"));

View solution in original post

5 REPLIES 5

Vishal Birajdar
Giga Sage

Hi @Abhilasha G T 

 

1. First you can put different sys_id's in as comma (,) separated list 

e.g., alksdje28eyhdj893,hdgiuwe12ewf8

 

2. In your code use below query

wo.addEncodedQuery('parent=' + current.sys_id + '^templateIN' + gs.getProperty('your_property_name'));

                                                 or 

In case above query does not work, use below :

wo.addEncodedQuery('parent=' + current.sys_id + '^templateIN' + gs.getProperty('your_property_name').toString());

 

 

 

Vishal Birajdar
ServiceNow Developer

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