Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to create system property that simplifies code and use in Business rule?

Deepika61
Tera Contributor

Hi all,

Actually in time sheet we have tasks , to display those tasks we have to mention tables in the below

 

 

Deepika61_1-1704950770867.png

once we added our required table here , it will display on the tasks list ,once it is available , there is one custom BR is there checking here also

Deepika61_2-1704951235153.png

now the concern was like whenever we want another task to task list in time sheet we need to change these two places 

so now i want to create one system property that combines these two things and need to used in , because of that instead of changing two places , simply we can update system property

 

Please help me to achieve this

Thanks

Deepika

7 REPLIES 7

shloke04
Kilo Patron

Hi @Deepika61 ,

 

1. Create a System Property first by navigating to "sys_properties.LIST".

Within your Widget, define a variable on the top of Server Side component of the widget as below:

data.getProp = gs.getProperty('Property Name');

Then update the line in your widget screenshot as below:

"tables":data.prop,

Now, update your business rule as below:

var prop = gs.getProperty('property name');
if(!gr.next() && prop.indexOf(current.task.sys_class_name)>-1){
current.setAbortAction(true);
}

 

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

@shloke04 

Thanks for the response

Actually its an instance which was in first screenshot

and what i need to mentioned in the value for the property?

and in the BR we have moved the condition to in condition field like this

Deepika61_0-1704963794694.png

Then how we use the property for this BR?

 

Thanks

Deepika

Ankur Bawiskar
Tera Patron
Tera Patron

@Deepika61 

in new system property add those 2 tables as comma separated value

please share the BR code

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

@Ankur Bawiskar 

Thanks for the response

how should i mentioned in the property value?

Deepika61_1-1704965128235.png

 

this is the BR 

Deepika61_0-1704964785076.png