0

I have a checkbox field named "Approval" that is checked and not checked when creating a candidate record to see if they have been approved. What I'm trying to do is create a formula text field named “Custom Approval Message” that will dynamically display this:

  1. “Record not yet approved” – When a candidate's test record has not yet been approved.

  2. “Record has been approved” – When a candidate's test record is approved.

My main question is how to achieve this using a custom formula field.

What I have so far:

A candidate object with fields Name, Salary, and approval (checkbox set at false).

Now I want a new formula text field record to display the above information based off if the checkbox has been checked or not. I created a new formula text box and keep getting errors with this:

IF(
    [Approval__c] == True, 
    "Record has been approved",
    [Approval__c] == False, 
    "Record not yet approved"
)

I'm very new to using salesforce and cannot figure out how to do this. Any help appreciated

1 Answer 1

2

In a formula (formula field, workflow, process builder, flow), the IF() function takes 3 arguments (as indicated in your previous question by looking through the Formula Operators and Functions).

  • Boolean value (or a boolean expression)
  • Value if true
  • Value if false

And that's in the specific order used.

Given that your target field is Boolean (i.e. a Checkbox, something that can only hold true/false), you don't need to test for equality to true or false.

In accordance with Boolean logic
<true> = true results in true
<true> = false results in false
<false> = false results in true
<false> = true results in false
Where the value inside of <> represents the value of your checkbox field

In this case you don't need to test for equality, you can use the Boolean value of the checkbox field directly.

IF(
   Approval__c,
   /* Value when true (i.e. the checkbox is checked) */
   'Record has been approved',
   /* Value when false (i.e. the checkbox is not checked) */
   'Record has not been approved'
)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .