0
votes

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:

1

1 Answers

1
votes

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 "")