Compares and returns a text value.


Compare(textValue1, textValue2, isCaseSensitive)

Enabled For

For a description of the business object categories, see Notes on "Enabled For".

Business Object Category Yes/No
Business Rules: Before-Save Rules Yes
Business Rules: Calculation Rules (After Save, with or without Also Recalculate on Load) Yes1
Business Rules: Calculation Rules (Before Save or Always, without Also Recalculate On Load) Yes
Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load) Yes1
Business Rules: Editing Rules Yes2
Business Rules: Initialization Rules Yes
Business Rules: Read Only Rules No
Business Rules: Required Rules Yes2
Business Rules: Validation Rules Yes
Client Expressions No
Object Permissions No
Services No
Mobile No
Quick Actions (except UI Quick Actions) Yes
UI Quick Actions No
Reports Yes
Search/Dashboard without field references No
Search/Dashboard with field references No

1. The function is not fully supported in calculation rules that have a condition of After Save or that have the Also Recalculate on Load option selected. It may fail if the rule's field is used in a grid, form, or saved search.

2. Except when this field appears on a form or is triggered by such a field.


Parameter Description
textValue1 textValue1 for Compare


textValue2 for Compare


(Optional) To check case sensitivity for the values

Return Value

Returns bool value (true or false) based on comparison.


$(Compare('This is red color', ' This is red color '))

Returns this value: True.

$(Compare('This is red color', ' This is red Color ', true))

Returns this value: False