MyRapidi
MyRapidi

Search our Wiki

BLANKVALUE

BlankValue(expr, expr2)

The BlankValue(expression, expression-if-blank) returns "expression-if-blank" if the "expression" evaluates to blank or null, otherwise it returns "expression". The function can be used instead of a combination of IF and EQUALS functions and generally make the overall formula shorter and easier to read.

 

Some examples:

BlankValue(TAXGROUP, 'LOCAL')     ---> returns 'LOCAL' if the value of the TAXGROUP field is blank or null, otherwise it returns the value of the TAXGROUP field.

BlankValue(DBLookup('DESTDS','User','Alias',"Salesperson",'Id'), DBLookup('DESTDS','User','Alias','MB','Id'))   ---> returns the Id of the User with alias as in the Salesperson field if this user exists in the destination, otherwise it returns the Id of the User with alias "MB".

 

The formula 
##IF(EQUALS(DBLookup('DESTDS','User','Alias',"Salesperson",'Id'),''), DBLookup('DESTDS','User','Alias','MB','Id'),DBLookup('DESTDS','User','Alias',"Salesperson",'Id'))
   

 

can now be written as 

##BlankValue(DBLookup('DESTDS','User','Alias',"Salesperson",'Id'), DBLookup('DESTDS','User','Alias','MB','Id'))