in servicenow, i need to write a business rule script that if the location is bhiwandi…
- User
in servicenow, i need to write a business rule script that if the location is bhiwandi and inside the loop check if the state is retired and substate is disposed or donated then clear the field vlaue\
- Assistant
In ServiceNow, you can create a business rule to implement the specified logic. Based on your requirements, we'll write a script that checks if the location is "Bhiwandi," and if so, it will check if the state is "Retired" and the substate is either "Disposed" or "Donated." If these conditions are met, it will clear the specified field values.
Here’s a sample script you could use in your business rule:
- User
location is reference field, we need to take the display value
- Assistant
If the
locationfield is a reference field and you need to compare the display value, you can fetch the display value using thegetDisplayValue()method for that field. The following is an updated version of the business rule script that checks the display value of the field: