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

A Set Variable component saves the current payload to a variable.

What is the DataWeave parent expression to access the variable?

    Correct Answer: B

    To access a variable in DataWeave, you use the 'vars' keyword. The syntax to access a specific variable would be #[vars.variableName]. This is the standard way to refer to variables set in a Mule event.

Discussion
AquawormOption: B

https://docs.mulesoft.com/dataweave/2.4/dataweave-variables-context vars All variables currently set on the current Mule event being processed. Fields: No fields. Example: #[vars.myVar] returns the value of myVar.

ExamDevOption: B

#[vars.{nameOfVaraible}] Example: #[vars.myVar] => returns the value of myVar.

ilya_tsyOption: B

vars is correct

sirious09Option: B

B is correct

RahulJain464Option: B

it is B. Vars

EsquerdoOption: B

vars. letter b

b_muleyOption: B

Try it out in Studio :) It's vars, so "B"

EmpireOption: B

OPTION "B" IS CORRECT.

Igors78Option: B

Mule4 -> vars

AquawormOption: C

https://docs.mulesoft.com/dataweave/2.4/dataweave-variables

Sephyre1988

var in that case is a reserved keyword from JAVA