MuleSoft Associate Development Fundamental Practice Test

Access More Questions
Refer to the payload: [{ "orderID": 592, "shipping": "international", "city": "Tokyo" }, {"orderID": 972, "shipping": "domestic", "city": "Cleveland" }]. Which MEL expression accesses the city Cleveland?
Correct Answer:
#[message.payload[1].city]
Explanation:
Accessing a value from an array by its position in MEL uses square brackets after the array reference, then the property you want. The payload is an array with two objects, and the Cleveland city is in the second object (arrays are zero-based, so index 1). So you go to the second element and read its city: that is message.payload[1].city, wrapped in MEL syntax as #[message.payload[1].city], which yields "Cleveland". The other forms would return different data or fail: indexing [0] would give Tokyo, indexing [2] would be out of bounds, and referencing payload without the message context is less explicit and may not resolve correctly in all contexts.

Access more questions from this quiz

Continue to MuleSoft Associate Development Fundamental Practice Test for more practice questions and the full quiz experience.

Access More Questions