I have a Json Input like below, where if doa
is null or "" it needs to replace with the value test
if it contains Value then no change required. I have achieved in dwl 2 version using update
. Using mabObject in dataweave 1.0 version, but it is not working out. Looking for your expertise. Thanks
Input:
{
"sets": {
"exd": {
"cse": {
"doa": null
}
}
}
}
Achieved in dwl 2 :
%dw 2.0
output application/json skipNullOn="everywhere"
import * from dw::util::Values
---
if
(!isEmpty (payload.sets.exd.cse.doa )) payload
else
payload update
{
case .sets.exd.cse.doa! -> "test"
}
Response
{
"sets": {
"exd": {
"cse": {
"doa": "test"
}
}
}
}
Looking for Mule 3 dataweave 1.0 version of it??