User Tools

Site Tools


syntax:functions:ifempty

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
syntax:functions:ifempty [2015/03/27 17:50] elenapsyntax:functions:ifempty [2021/08/16 03:17] (current) craigt
Line 1: Line 1:
 ====== IfEmpty(expression1, expression2) ====== ====== IfEmpty(expression1, expression2) ======
 +Category:  Logical function
  
-Returns result of //expression2// if //expression1// is empty. Otherwise returns result of //expression1//+\\  
 +=====Description===== 
 +This function returns the result of //expression2// if the result of //expression1// is empty.  Otherwise, it returns the result of //expression1//.
  
 +\\ 
 +=====Use cases=====
 +This function can be used as an error handler in cases where an expression could potentially return an empty value.  In such a case, the return value from //expression2// acts as a "safety net" so the process can continue.
  
- Expression   FieldA   Result  +\\  
-IfEmpty( [FieldA], 'Other) |  | Other  +=====Arguments===== 
-IfEmpty( [FieldA], 'Other'Another  Another  |+^Argument^Type^Description
 +|expression1|Expression|Any expression that could potentially have an 'emptyresult being tested for.
 +|expression2|Expression|Any expression.| 
 +**Return value type:** Any (The data type of the return value of //expression1// or //expression2//.)
  
-**See also** +\\  
-  * [[syntax:functions:isempty]]+=====Remarks===== 
 +If both //expression1// and //expression2// evaluate to an empty value, an empty value is returned. 
 + 
 +\\  
 +=====Examples===== 
 + 
 +  ifempty( [FieldA], 'Other' ) //Returns 'Other' (assuming [FieldA] is empty) 
 + 
 +  ifempty( [FieldA], 'Other' ) //Returns 'Another' (assuming [FieldA] = 'Another'
 + 
 +\\  
 +===== See also ===== 
 +  * [[syntax:functions:isempty|IsEmpty(expression1)]]
syntax/functions/ifempty.1427493033.txt.gz · Last modified: 2015/03/27 17:50 by elenap

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki