+ Start a Discussion

Compare two text fields only when they have values

I have two text fields , Submitted By and Approved on Case . I need to compare these values in a Validation Rule only (check if both are equal)when both have value not when one of them are Blank. 
Submitted By field is getting Updated by Intially Submission action of Field Update in Approval Process whereas Approver field is getting updated by Approval Action.I need to trigger a Validation when Approver and Submitter are equal?Please help
ShirishaShirisha (Salesforce Developers) 


You need to use the criteria to forumla evaluates to true and build the formula like below:
Field1 == Field2

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Shirisha Pathuri
veer soniveer soni
Hi Erve,
Try following dummy rule in your validation.
IF(FirstName=LastName, true, false)
let me know, if it helps you and marking it as best Answer.
Thank You
Thanks for the response  Veer and Shirisha.

My usecase is validation rule should trigger when both the fields have values .Submitted by field populates first and then Approver field later .I want condition like below
1. NOT(ISBLANK(Submitted by) ==  NOT(ISBLANK(Approver)
2. During new record creation before I hit submit for approval both the fields are null and when I compare the fields for equal validation rule triggers which I do not want. Validation rule should trigger when both the values are equal when not blank(field 1 == field 2, except when they are blank).

Thank You . Hope this clarifies my requirement