I am trying to set a variable value from an incoming payload field. I am using a custom expression like upper(payload.name), but it is not working as expected. Input Payload: { "name": "ben", "age": 100 } Current Output: { "resp": "PAYLOAD.NAME" } Issue: The expression is being treated as a literal string rather than referencing the payload field. Question: How can I correctly access the incoming payload fields in MuleSoft Composer so that the name field is transformed to uppercase?
The expression upper(
payload.name) is the correct syntax to convert the name field in the payload to uppercase. However, the issue occurs because MuleSoft Composer is treating the expression as a literal string instead of evaluating it.To fix this, make sure you enter the expression in expression mode (usually by clicking the fx button next to the input field) rather than as plain text.
Enter the expression without enclosing it in quotes. For example, enter this exactly:
upper(payload.name)
not as "upper(payload.name)" or 'upper(payload.name)'.
Entering the expression without quotes ensures that Composer evaluates it rather than treating it as a string literal.
You can also use the Expression Builder or preview features to verify the output before running the app.
https://docs.mulesoft.com/anypoint-code-builder/int-configure-dw-expressions
https://docs.mulesoft.com/dataweave/latest/dw-core-functions-upperThanks!