MCD - Level 1 Exam QuestionsBrowse all questions from this exam

MCD - Level 1 Exam - Question 45


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

What is the DataWeave parent expression to access the variable?

Show Answer
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

10 comments
Sign in to comment
AquawormOption: B
Feb 21, 2022

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.

AquawormOption: C
Feb 21, 2022

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

Sephyre1988
May 30, 2022

var in that case is a reserved keyword from JAVA

Igors78Option: B
Mar 25, 2022

Mule4 -> vars

EmpireOption: B
Mar 31, 2022

OPTION "B" IS CORRECT.

b_muleyOption: B
May 4, 2022

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

EsquerdoOption: B
Aug 7, 2022

vars. letter b

RahulJain464Option: B
Aug 10, 2022

it is B. Vars

sirious09Option: B
Aug 16, 2022

B is correct

ilya_tsyOption: B
Sep 8, 2022

vars is correct

ExamDevOption: B
Jan 22, 2024

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