0

New to Mule4 and playing around. I have a setPayload transformer and under setting I am adding the following

#[payload ++ " " ++  message.attributes.queryParams.lname]

However I am getting the following error. What is the right way of doing this?

Scripting language error on expression 'payload ++ " " ++ message.attributes.queryParams.lname'. Reason: Unable to call any overload of function ++ with arguments (String, String | Null) overloads:

borna
  • 906
  • 3
  • 12
  • 32

1 Answers1

1

You cannot concatenate String (i.e. "Hello") with null ( i.e. attributes.queryParams.lname could be null). So in this case, you will have to set a default value to the right-hand side expression. try below script -->

"Hello" ++  (attributes.queryParams.lname default "")
Deep
  • 71
  • 7