How can we handle null value in string

0
I am storing First name + Last name in an attribute. However when last name is null, it stores : John null. How can null values be handled? I am doing the concatenation via microflow.
asked
2 answers
3

Additional to thijs answer: as an empty string and a string which is empty are 2 different things - empty vs '' - use this expression

(if trim($Firstname) != '’ then  $Firstname else empty) + 

(if trim($Lastname) != '’ then $Lastname else empty)

 

Edit: replaced comparison on empty with comparison on '’ ( thanks Ward)

answered
2

Hoi Pragya, 

 

You could try an IF THEN ELSE statement:

(If $Firstname != empty THEN $Firstname ELSE ‘’) + 

(IF $Lastname != empty THEN $Lastname ELSE ‘’)

answered