ui-only formula fields cannot compare to strings???

  • 1
  • Problem
  • Updated 3 years ago
  • Not a Problem
  • (Edited)
Here's a simple formula:

IF({{Status__c}}=='Scheduled',true,false)

In runtime, I get the error:
"Invalid syntax for field formula: IF({{Status__c}}=='Scheduled',true,false). ReferenceError: Scheduled is not defined"
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
  • shocked and alarmed!

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Here is the syntax I have used to good effect: 

IF({{StageName}}=="Needs Analysis","Hop To It","Chill")

I think double quotes are your friend... 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
No luck:

Invalid syntax for field formula: IF({{Father_of_the_Baby_Intention__c}}=="Abort",true,false). ReferenceError: Abort is not defined
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
^^bump^^
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
This still an issue for you?

Briefly had the same issue until I found this post and saw the double equals "==".

Your formula is using single quotes and I get the same error when using single quotes. Have you switched to double quotes?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I believe this was fixed with 7.19
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi,

Anyway to do the same for large text type fields to see if Null?

IF({{field__c}}== "",0,1)

When I tried i get the following error: SyntaxError: Unexpected token ILLEGAL

Thx
Photo of Greg Johnson

Greg Johnson

  • 602 Points 500 badge 2x thumb
We're trying to generate a UI-only field (checkbox) to indicate if a large text field has contents as well - any tips?