They are several ways to format values during the merging, but by default TBS converts data items into strings using the PHP implicit conversion.
Thus, true
is converted into '1' and false
is converted into '' (empty string).
For the non-existing value: If the key in the array you want to merge does not exist, then you can avoid the TBS error message using parameter noerr
, and the value for replacement is '' (empty string).
So your solution is :
[test.ativated;noerr;if [val]=1;then 'Activated';else 'non-activated']