3.29A more realistic reusable function
Say several fields need defaults:
%dw 2.0
output application/json
fun clean(value) =
trim(value default "")
---
{
FirstName: clean(payload.firstName),
LastName: clean(payload.lastName),
Company: clean(payload.company)
}
This is much cleaner than performing each manipulation through Mule processors.