MyRapidi
MyRapidi

Search our Wiki

BLANKVALUE

BlankValue(expr, expr2)

The ##BLANKVALUE formula is used to handle cases where a value might be blank (null, empty, or missing) by providing a fallback or default value. It checks whether a given value is blank and, if so, returns an alternate value; otherwise, it returns the original value.

The function can be used indepdently or in combination with other formulas such as ##DBLOOKUP, ##IF, ##EQUALS, ##LSLOOKUP. 

Examples:

##BLANKVALUE(TAXGROUP, 'LOCAL')


This formula will return 'LOCAL' if the value of the TAXGROUP field is blank or null, otherwise it returns the value of the TAXGROUP field.

##BLANKVALUE(Payment_Terms_Code__c,SKIPFIELD())


If Payment_Terms_Code__c has a value (i.e., it is not blank):

  • The formula returns the value of Payment_Terms_Code__c.
  • The field is updated or mapped with this value.

If Payment_Terms_Code__c is blank:

  • The formula evaluates to SKIPFIELD(), and the field is skipped (left unchanged).
  • No update or mapping occurs for this field.

 

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

OR

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

Step-by-Step Explanation: 


  • First Lookup:

DBLookup('DESTDS', 'User', 'Alias', "Salesperson", 'Id'):

  1. Queries the 'User' table in the 'DESTDS' data source.
  2. Searches for a record where the 'Alias' field matches "Salesperson".
  3. Returns the value of the 'Id' field if a match is found.
  4. If no match is found or the result is blank, the formula moves to the second argument.
  • Fallback Lookup:

DBLookup('DESTDS', 'User', 'Alias', 'MB', 'Id'):

  1. Queries the same 'User' table in the 'DESTDS' data source.
  2. Searches for a record where the 'Alias' field matches 'MB'.
  3. Returns the value of the 'Id' field if a match is found.
  4. This value is used only if the first DBLookup returns blank.

Behavior of ##BlankValue:

  1. If the first lookup ("Salesperson") succeeds, its result is returned.
  2. If the first lookup fails (returns blank), the result of the second lookup ('MB') is returned.