Exam MCD - Level 1 All QuestionsBrowse all questions from this exam
Question 71

Refer to the exhibits.

The Set Payload transformer's value is set to {`˜year': `˜2020'}.

What message value should be added to the Logger component to output the message `˜The year is `˜2020', without hardcoding 2020?

    Correct Answer: D

    To output the message 'The year is 2020' without hardcoding the year value, the correct syntax in the MuleSoft Logger component should utilize DataWeave expression language. The expression that concatenates a string with a payload field is written using '#[]', with the variable expression inside the brackets. The correct format for achieving this is '#["The year is " + payload.year]'. This will dynamically fetch the 'year' value from the payload and concatenate it into the string, resulting in the desired output.

Discussion
sshams2021Option: A

"The year is #[payload.year]"

calazansOption: A

A is correct

ExamDevOption: A

"The year is #[payload.year]"

peeman004Option: A

Funny enough, I tried it and it seems both A and B seems to work. A is not the most natural thing though -- as you typically click on the FX button and that put the brackets around the whole expression.

peeman004

No, I'm wrong -- B only works with quotes around: message='#["The year is $(payload.year)"]' but that's not in the option. Sorry for confusion...

mubashirhassan2030Option: A

Refer to the exhibits. The Set Payload transformer's value is set to {`˜year': `˜2020'}. What message value should be added to the Logger component to output the message `˜The year is `˜2020', without hardcoding 2020? A. "The year is #[payload.year]" B. "#[The year is $(payload.year)]" C. "#["The year is ++ payload.year"]" D. "#["The year is " + payload.year]"