Thanks Del.
It works like a charm, but I had another issue with given expression.
Usually, when we have blank value in xml, the closing field name should be removed. It doesn;t work with above expression.
For example, when Field2 is blank, it should completely remove the $ value. I tried filter function on values ($.filter((val, key) => (val != ‘’))), but it was not working as it works on entire column($) after conversion as per our expression.
Desired output, when field2 is blank
[
“h1”: {
“h2”:{
“f”:[
{“@name”:“Field1”,“$”:“10/3930”},
{“@name”:“Field2”}
]
}
}
]
Regards,
San