In a Business Rule what should be the syntax of condition

Community Alums
Not applicable

Suppose in a business rule I want to add a condition on Advance option that it shoud only run on a particular table.
 

UTSAVJAISWAL_0-1680372776030.png

Please help me to write a code in condition field that the business rule should only run on a particular table.

Thanks
Utsav

9 REPLIES 9

Hello @Utsav JAISWAL 

Please mark Correct and click the Thumb up if my answer helps you solved your issue. Thanks!

If my response was helpful, please mark it as correct and helpful.
Thank you.

Hi @Community Alums 

Can you please mention what kind of condition you are planning to put so that i can help you in the best possible way.

You can use any script include and also you can use if condition over there.

Basically the condition field should return true.

Let me know the condition which you are planning. I will help you with the best possible way.

 

Mark helpful if it helps in solving your query.

 

Regards,

Johns

Hi Utsav,

You can use current.getTableName() in the condition field to get the table name.

If this is what you are looking for.

 

Best Regards,

Swarnadeep Nandy

Upender Kumar
Mega Sage

Business rules run when an operation is performed on a table. If you are writing a BR on top table then you can use class field in When to Run section.

UpenderKumar_0-1680441611430.png

The condition field is visible in advanced view when you want a custom condition that can not be performed via When to run section. In this section, you can also use script includes.

 

https://developer.servicenow.com/dev.do#!/learn/courses/rome/app_store_learnv2_scripting_rome_script... 

 

 

Manny11
Tera Expert

Example:      current.time_spent != previous.time_spent

Current.field_name 

Current.variables.field_name