BR condition is failing

Prithvi Ramesh1
Mega Sage

PrithviRamesh1_0-1790809959393.png

Refer the screenshot and let me know where am i wrong since the condition is not working as intended.

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@Prithvi Ramesh1 

try to use toString() on both the fields while comparing with true

Also are you sure the script include function is returning true?

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

yashkamde
Giga Sage

Hello @Prithvi Ramesh1 ,

 

The condition seems fine..

Ensure if ProcurementOrderValidator lives in a scoped app, The Script Include's Accessible from must also be set to All application scopes.

 

Also current.received == 'true' ususally works but it's fragile though so try using :
current.getValue('received') == '1'

OR 

current.received == true

 

If my response helped mark as helpful and accept the solution.

 

Aditya_hublikar
Giga Sage

Hello @Prithvi Ramesh1 ,

 

Have you checked the data type of Received and Source? Are they Boolean or String?

If they are Boolean fields, you can check the condition like:

current.received == true && current.source == true

Also, verify what values are being returned from your Script Include. Since you are using the && (logical AND) operator, all three conditions must evaluate to true for the overall condition to be true and for the Business Rule to execute.

 

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya