Delcare an empty array and add elements in the mule flow
We had a requirement to initialise an empty array and then collect(or add) items to it in the flow and at the end create a for loop for each of the items in that array
so we declared a flow variable with the value
#[[]]
the “[]” inside the #[] creates an empty array.
And then you can add items into this array by
flowVars.VariableName.add("your content here");
And at the end when you want to loop through this array, in the foreach set the this variable name flowVars.VariableName
on the other note(not related to above array), just if we want to set the pay load to null, then in setpayload shape use this
#[null]
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