I was hoping to get some ideas on how can I go about doing this.

So I want to run a report that checks if one Encrypted field in one of our objects is empty but we cant use encrypted fields in any of the filters or anywhere.

We needed a way to check so we originally thought we could have a formula field and have a checkbox to see if it's empty if it is then check it. Unfortunately looks like Salesforce won't allow that I keep getting the 'Unsupported field type called "Text (Encrypted)'. Is there another way of doing this?

Actual formula : IF(LEN(CODE__c)==0,0,1)

Error: ' You referenced an unsupported field type called "Text (Encrypted)" using the following field: CODE__c'

Can we use apex class to check this instead?

  • Can you share the formula that is causing an error? Jun 8, 2021 at 17:46
  • 1
    Hi, @MohithShrivastava I have added the formula. Jun 8, 2021 at 18:19
  • Is it LEN? I see LENT there Jun 8, 2021 at 18:22
  • @MohithShrivastava its LEN Jun 8, 2021 at 18:28
  • 1
    Please don't abuse the [community] tag, only add it when actually asking about the Communities feature.
    – Adrian Larson
    Jun 8, 2021 at 19:49

1 Answer 1


There are only a handful of formula functions that are supported by encrypted fields. Check the list here

Supported operators and functions are below

  • & and + (concatenate)


  • CASE


  • IF




Also carefully note below

Formulas can return data only in text, date, or date/time formats.

For your use case, LEN is not supported.

A workaround could be a simple before insert and before update Apex Trigger as those will have access to the encrypted field.

  • I tried with ISBLANK but still getting the same error Jun 8, 2021 at 19:33
  • Can you try other functions as well and see if you receive the same error? Jun 8, 2021 at 19:35
  • Yup same errors Jun 8, 2021 at 19:39
  • What is the return type of your formula? Jun 8, 2021 at 19:40
  • Note that you can only return Text, date, or date/time. So I suggest return a text field called YES or NO Jun 8, 2021 at 19:41

You must log in to answer this question.

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