1
votes

How to write nested while looping in mule dataweave

I have code like this,

 (UnitMeasureVal:"EACH") when ($.@attribute-id) == "UnitMeasure"
 and ($ is :empty or ($ =="N/A" or $ =="NA")) otherwise  (UnitMeasureVal: $),

But its giving error, I am not able to add otherwise condition in this. I want to assign $ value in otherwise section

1
What error are you getting?Arcath
Its not accepting the expression that I have posted.. Giving error like Invalid input 'ot'Rohan Shinde

1 Answers

2
votes

We can do nested looping in Mule Dataweave. Just need to take care of parenthesis to make it.

This is the correct expression for my above expression:

(UnitMeasureVal:$ unless ($ is :empty or $ =="N/A" or $ =="NA") otherwise "EACH") when $.@attribute-id == "UnitMeasure"