nerdexam
MuleSoft

MCD-LEVEL-1 · Question #142

Which keyword do you use to create a new function in DataWeave?

The correct answer is B. fun. You can define your own DataWeave functions using the fun declaration in the header of a DataWeave script. Sample is as below. ---------------------------------------- output application/json fun toUpper(aString) = upper(aString) toUpper("hello") MuleSoft Doc Ref…

DataWeave Transformations

Question

Which keyword do you use to create a new function in DataWeave?

Options

  • Bfun
  • Cfunc
  • Dmap

How the community answered

(32 responses)
  • B
    88% (28)
  • C
    3% (1)
  • D
    9% (3)

Explanation

You can define your own DataWeave functions using the fun declaration in the header of a DataWeave script. Sample is as below. ---------------------------------------- output application/json fun toUpper(aString) = upper(aString) toUpper("hello") MuleSoft Doc Ref : https://docs.mulesoft.com/mule-runtime/4.1/dataweave-functions

Topics

#DataWeave#function syntax#fun keyword

Community Discussion

No community discussion yet for this question.

Full MCD-LEVEL-1 Practice