function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
brkandivybrkandivy 

Formula help: Need to compare two fields

I am trying to build a field update to update one field if two other custom fields match.  How can I write the formula to check if those two custom fields are equal?  Thanks in advance for any help!!

Steve :-/Steve :-/

What is the datatype of the fields that you are trying to compare? 

brkandivybrkandivy

Hi,

 

They are custom text fields

Steve :-/Steve :-/

Then this forula should work for you

 

API Field Name 1 = API Field Name 2

 

What part are you having trouble with?  the Formula or the WFR?

 

brkandivybrkandivy

Hi,

 

I'm having difficulty with the actual formula. Both the fields are custom text fields.   It should be easy enough, but this is the error I'm getting:

 

Error: Formula result is data type (Boolean), incompatible with expected data type (Text).

 

This is the formula I have:  School_District_Number__c = District_ID__c

Steve :-/Steve :-/

Okay what exactly are you trying to do?  When you said "I am trying to build a field update to update one field if two other custom fields match."  that sounds like you're trying to create a trigger for a Workflow Rule with a Field Update Workflow Action. 

But the error message makes it sound like you're trying to create a Formula field that displays a value if the text fields that you're evaulating are equal.  

 

Can you explain exactly what it is that you are trying to do so that I can try to get a handle on it?

Like "IF Field1 = Field2 THEN update Field3  with TRUE, IF Field1 = Field2 THEN update Field3  with FALSE". 

Also, lit the datatypes and values of ALL of the fields and objects that you are evaluating

brkandivybrkandivy

It is a field update workflow.  I have a third custom field (A checkbox) that I want checked if those other two fields match.

Steve :-/Steve :-/

Can you post a screenshot of your WFR configuration?  Or copy & paste it using the clipboard?

brkandivybrkandivy

WFR

 

Field Update

 

Not sure if these pics will work or not

Steve :-/Steve :-/

The images are not displaying, how did you post them?

brkandivybrkandivy

Sorry, new to this and the usual screenprint and paste is not working here.  So I saved a pic and used the insert/edit image, but thats not working as I expected either.

Steve :-/Steve :-/

Yeah they certainly don't make it easy that's for sure... 

Can you try posting it on a hosted site like GoogleDocs, Flickr, or ScreenCast http://www.screencast.com

Steve :-/Steve :-/

Okay, that is not how you create a Workflow Rules with a field Field Update, it looks like you're putting your WFR Trigger Formula inside the Field Update. 

 

First you need to create a Workflow Rule that evaluates the two custom Text fields that you want to compare.  

 

 School_District_Number__c = District_ID__c

Then you need to create a Workflow Action (to be triggered when the above formula evaluates to TRUE)  

In the Workflow Action(Field Update) specify the field you want to update (your custom checkbox) and the value you want to set the field to TRUE/FALSE.

 

Here's some more information on getting started with WFR's let me know if you need any help

 

 

https://na1.salesforce.com/help/doc/en/salesforce_workflow_cheatsheet.pdf

 

https://na1.salesforce.com/help/doc/en/salesforce_useful_workflow_rules.pdf