CONCAT_NON_EMPTY ()

CONCAT_NON_EMPTY ()

CONCAT_NON_EMPTY(separator, text [, text, text...])

API Version

2.7.26 and higher

Concatenates a list of strings, ignoring the ones that are empty

Creates a concatenation of all the strings passed as parameters separating them with the string provided in the parameter separator.

The strings that have an empty value will be ignored in the final concatenation.

Input Parameters

Parameter

Type

Default

Required

Description

Parameter

Type

Default

Required

Description

separator

String

 

Yes

String that will be used as separator when concatenating the strings

 

text

String/Array

 

Yes

This parameter can be repeated as many times as necessary. The list of text parameters provided will be concatenated using the separator specified.

It is also possible to pass an array as parameter. In that case, each item of the array will be included in the final concatenated string

Execution

Always. Calculated on-the-fly whenever an ITEM of a FORM is changed (by means of form_set_answer(), or when the FORM is opened

Examples

Formula

Description

Formula

Description

CONCAT_NON_EMPTY(“-”, “1”, ““, “3”)

The evaluation of this formula will return:

“1-3”

Note that the empty string has been ignored in the final concatenation

CONCAT_NON_EMPTY(“-”, “1”, [“a”, ”b”], ““, “3”)

The evaluation of this formula will return:

“1-a-b-3”

In this example we have passed an array as one of the parameters. The final concatenated string contains the items of the array