New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Certified MuleSoft Developer (Mule-Dev-201) Exam - Topic 6 Question 38 Discussion

Actual exam question for Salesforce's Salesforce Certified MuleSoft Developer (Mule-Dev-201) exam
Question #: 38
Topic #: 6
[All Salesforce Certified MuleSoft Developer (Mule-Dev-201) Questions]

What is the correct syntax for a Logger component to output a message with the contents of a 3SON Object payload?

Show Suggested Answer Hide Answer
Suggested Answer: B

Option 3 is the only corect answer as it concatenates payload with String.

Below option wont work.

#['The payload is ' ++ payload]

Concatenation function expects both arguments to be string. As the question says payload is json object , this will throw error while running it. You can try this in Anypoint Studio and you will get the same result which I mentioned.

hence correct answer is

The payload is: #[payload]


Contribute your Thoughts:

0/2000 characters
Margot
13 days ago
Haha, option A is just asking for trouble. Trying to embed the payload directly in the string? No thanks!
upvoted 0 times
...
Elise
18 days ago
D seems like the correct answer. Concatenating the string with the payload variable is the way to go.
upvoted 0 times
...
Leonor
23 days ago
Option C looks good to me. The syntax for outputting a JSON object payload seems straightforward.
upvoted 0 times
...
Buddy
28 days ago
I’m a bit confused about the difference between the + and ++ operators in this context. I guess I’ll have to choose between C and D.
upvoted 0 times
...
Annelle
1 month ago
I feel like I saw a question like this in our last practice exam, and I think it was about using the ++ operator, which makes me lean towards B.
upvoted 0 times
...
Rory
1 month ago
I remember something about using the #[ ] syntax for expressions, so maybe it's C or D?
upvoted 0 times
...
Margarita
1 month ago
I think the syntax for outputting a message with a payload might be similar to string concatenation we practiced, but I'm not sure which operator to use.
upvoted 0 times
...
Flo
2 months ago
Ah, I've got it! The correct syntax is using the # symbol to represent the JSON object. Option C looks like the winner to me.
upvoted 0 times
...
Luisa
2 months ago
I've seen this type of question before. I think the key is figuring out how to properly interpolate the payload variable into the log message.
upvoted 0 times
...
Leila
2 months ago
I'm a little confused by the options here. I'll need to review my notes on logging JSON data to make sure I choose the right syntax.
upvoted 0 times
...
Yesenia
2 months ago
Okay, let's see... I'm pretty sure the correct answer has something to do with using the # symbol to represent the JSON object.
upvoted 0 times
...
Keneth
2 months ago
Hmm, this looks like a tricky one. I'll need to think carefully about the syntax for logging a JSON object.
upvoted 0 times
...

Save Cancel