Checking for blank values

Hi experts,
I need to execute a condition where a particular value is not equal to blank.can u please tell me how to do that.(i tried a branch step with switch condition by leaving the Label property blank (empty).It doesnt work can some one plz help me

Thanks in advance


RMG or someone please help

Use /[^ ]/ as the label of the step you want to execute when the string is not null or empty or only spaces.

This article may be helpful too.

Thanks Rob

This works if the field itself populating or not populating
Branch on the field(specify path) and under that use Sequence and set Label property to $null and sequence $default if value exits

If field exits and comes the blank value then use pub.string:length so branch on the /length and put sequences length >0 or length=0 this will check the whether field is blank or not.


Also you can make use of RegularExpressions on the Labels as Rob mentioned above.

For more information on how to use Regular Expressions and diff types,see the DeveloperUsersGuide.pdf.


can u please send me a screen of what u told above

Please make use of Regular Expressions,its easier and minimal code is required.


I’ve re-read your original question, and actually I find it a little ambiguous. What you mean by “blank” value, is it a space, empty string, or any white-space values? Using RegEx, you can have a condition to match any or all of the above. If you just want to match empty string, you can do something like %/EDI850/ISA06% == ‘’, but I digress…

Thanks,by Blank i mean spaces

I have used a label of one single space for a key that I am BRANCHing on. If it is a variable number of spaces then a label of /^ *$/ should work identifying all strings that are only spaces.

I don’t think I’ve seen this anywhere, so I’ll present a “Best Practice” of mine regarding RegEx.

Out here where I work (Taiwan), there seems to be a amazing lack of IT workers fluent with RegEx. Often when RegEx is used in services (or TN Doc Attrib queries for that matter), I have to worry about two things: 1) person(s) taking over maintenance of service might not understand (totally or partially) what I’m trying to achieve with particular RegEx; or 2) Somebody with better understanding of RegEx might spot what he/she thinks is an error, but cannot be sure.

To alleviate the problems, I always ask our developers to Comment their services, especially for RegEx.

Which comes back to why I’m writing this. Just nitpicking (but could be an important difference to some applications) Fred’s example of /^ *$/. Since Fred said what he was trying to achieve, it let me spot something: the example will match variable number of spaces, included zero(0) spaces, AKA empty-string. What we want to match is one (1) or more spaces, which would be /^ +$/