Using variables in Dataweave 1.0
Observation Notes:
Case 1: Using just variable name to assign to another field
here declared a variable named “category” with value as “Employee”
%dw 1.0 %output application/java %var category= "Employee" --- { Section: category }
In the above case, using the just variable name as-is will work. It will assign the value “Employee” to the Section.
Case 2: You want to use the variable value somewhere else code
%dw 1.0 %output application/java %var category= "Employee" --- { Section: category Location: payload."$(category)".Name }
if you notice above, now the variable has been used in double quotest with $ symbol to get the value of the variable “$(category)”
No comments yet.
-
Archives
- October 2023 (1)
- October 2022 (2)
- October 2021 (2)
- February 2021 (5)
- January 2021 (4)
- December 2020 (3)
- October 2020 (2)
- August 2020 (1)
- June 2020 (1)
- April 2020 (1)
- February 2020 (1)
- December 2019 (7)
-
Categories
-
RSS
Entries RSS
Comments RSS
Leave a comment