Lookup Selected boxes: how to get "is empty" or "is not empty"

Lookup Selected boxes: how to get "is empty" or "is not empty"

Whilst using SharePoint Designer to create a workflow I needed a way to check if a lookup column value was 'blank' or 'not blank'. This is not possible with Lookup type columns, but annoyingly and confusingly it is possible with other data types.
Figure 1
SharePoint only provides two operator options on lookup columns "Equal" or "not Equals". The problem is SP Designer will not allow you to simply enter a comparison value of "" or "blank" or "null".

This trick is to convert your Lookup value into a different data type, a string variable.
 
Example: I have a List containing a column called Projects, which is a lookup to another List (of projects info).
 
Figure 2

As you can see in Figure 2: First put your lookup value into a string variable.

Then use the string in your 'if' statement. You can now check if you value 'is empty' or 'is not empty'.



No comments:

Post a Comment