I am relatively new to Visual Workflow, and just trying to wrap my brain around some things... what is an empty string, and how is this different from "is null?"

Specifically, I am trying to write decision elements that check whether a field from a Record Lookup is blank... if it's blank, the flow skips on, if not, I'll have another step. I tried using "is null" for the operator in a decision outcome, but I need something in the Value... do I use GlobalConstant.True? Or should I be doing this another way, ie. equals EmptyString, or even equals and leave the Value blank?

Just looking for a little clarity...

Thank you!

3 Answers 3



Since you are using Workflow, you can use the functions listed on the following page:


Try using the ISBLANK function: pass any field into it, and if it is NULL or empty (""), i.e. has LENGTH = 0, the function will result to true, else it yields false.

EDIT : This answer is for Apex, not Workflow.

You can use comparison operators or a nifty String instance method


string t1='';
string t2=null;
string t3='i am not blank';    

// so you can see the results
    system.debug('t1 is null');
    system.debug('t1 is not null');

// so you can see the results
    system.debug('t2 is null');
    system.debug('t2 is not null');

// try this nifty string method
system.debug('t1 = "'+t1+'" -- String.isBlank(t1) = '+string.valueOf(String.isBlank(t1)));

system.debug('t2 = "'+t2+'" -- String.isBlank(t2) = '+string.valueOf(String.isBlank(t2)));

system.debug('t3 = "'+t3+'" -- String.isBlank(t3) = '+string.valueOf(String.isBlank(t3)));

See here for String Instance Methods.


You can have the Decision defined as field equals blank. In otherwords, have the Variable that you place the field value you attempted to retrieve on the left hand side, equals for the operator and leave the right hand side empty.


This answer relates to Flows (Create >> Workflows & Approvals >> Flows).

I had a similar issue where I needed to display a text field value from an sObject variable.

To determine if a value is null, you will need to use a decision element with two outcomes. Generally the following is suggested:

outcome1: {!variable.field__c} is null {!$GlobalConstant.True}
outcome2: {!variable.field__c} is null {!$GlobalConstant.False}

However, this did not correctly perform a null check on either text or date fields. Instead, the 'was set' operator worked for me:

outcome1: {!variable.field__c} was set {!$GlobalConstant.True}
outcome2: {!variable.field__c} was set {!$GlobalConstant.False}

Hopefully this helps someone else as well.

You must log in to answer this question.

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