MCD - Level 1 Exam QuestionsBrowse all questions from this exam

MCD - Level 1 Exam - Question 115


A web client submits a request to http://localhost:8081/books/0471767840. The value `0471767840` is captured by a Set Variable transformer to a variable named bookISBN.

What is the DataWeave expression to access bookISBN later in the flow?

Show Answer
Correct Answer: C

The correct DataWeave expression to access the variable bookISBN, set by a Set Variable transformer, is vars.bookISBN. In MuleSoft, variables set within the flow using the Set Variable component are accessible via the vars prefix.

Discussion

6 comments
Sign in to comment
almoraimaOption: C
Mar 28, 2021

Correct is C

awsuser1Option: C
Aug 29, 2021

C is correct.

jarit75Option: C
Aug 26, 2021

C is correct

RenatoJrOption: C
Aug 28, 2021

C is correct. Set Variable sets a variable in the current Mule event, and the variables then travel with the Mule event to downstream event processors. You can access any variable with DataWeave using vars. So if you set a variable named lastMessage, you can access it as vars.lastMessage. Reference: https://docs.mulesoft.com/mule-runtime/4.3/variable-transformer-reference

miguel_romeroOption: C
Dec 15, 2021

Correct is C

ExamDevOption: C
Jan 23, 2024

vars.bookIsbn