RemoveBlanks Function

Description 1 of 2 (remove blank texts from a list):
All members of the list other than blank texts.
This is particularly useful if you are collecting address information in separate variables and there is a possibility one field may not be answered on the questionnaire (eg the address line 2 field which is often optional).
Returns:
Text*
Parameter:
Parameter
Data Type
Description
1
Text*
The list of texts.
Examples:
When using functions inside a field, remember the field brackets:
{RemoveBlanks(List(If known(PremisesAddressLine1) then PremisesAddressLine1 else "", If known(PremisesAddressLine2) then PremisesAddressLine2 else "", If known(PremisesAddressCity) then PremisesAddressCity else "", If known(PremisesAddressPostCode) then PremisesAddressPostCode else ""))}
Expression
Result
RemoveBlanks( List("a","b","","c","") )
List("a","b","c")
RemoveBlanks( List("","","") )
List()
RemoveBlanks( List() )
List()
Description 2 of 2 (remove blank lines from a multi-line text):
Remove blank lines from a multi-line text.
This is useful if you are collecting addresses (or indeed any type of information) using a multi-line text variable and you are concerned the user may mistakenly add extra blank lines into the text box.
Returns:
Text
Parameter:
Parameter
Data Type
Description
1
Text
The multi-line text.
Example:
When using functions inside a field, remember the field brackets:
{RemoveBlanks(SellerAddress)}
Expression
Result
RemoveBlanks( "a^Lb^L^L^Lc^L" )
"a
b
c"

Related content