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…
Question
Which keyword do you use to create a new function in DataWeave?
Options
- Bfun
- Cfunc
- Dmap
How the community answered
(32 responses)- B88% (28)
- C3% (1)
- D9% (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
Community Discussion
No community discussion yet for this question.