12-03-2020 09:25 AM
Hello Team ,
can you please let me know how to remove null value objects .
Below is the example
Thanks in advance !
here is input
– INPUT
{
"ESTDATA": {
"TITLE": "Testing",
"DESCRIPTION": "Testing Json",
"VERSION": "",
"CURRN": "",
"TRANDS": {
"ATRANA": "ABC",
"ATRANB": "TEST",
"SERV": "N",
"kTYP": "N"
},
"DOCS": {
"TYP": "KTY",
"NO": "1230001230343",
"DT": "20/11/2020"
},
"DISPDTLS": {
"NM": "",
"ADDR1": "",
"ADDR2": "",
"LOC": "",
"PIN": 0,
"STCD": ""
},
"ITEMLIST": [{
"SLNO": "000010",
"DESC": "TEST 1 LTD",
"SERVC": "N",
"CDTLS": {
"NM": "",
"EXDT": "",
"WRDT": ""
},
"BAR": "",
"QTY": 1.0,
"ATTDTL": []
},
{
"SLNO": "000020",
"DESC": "TEST 2 ABCD LTD",
"SERVC": "N",
"CDTLS": {
"NM": "",
"EXDT": "",
"WRDT": ""
},
"BAR": "",
"QTY": 1.0,
"ATTDTL": []
}
],
"KCLDTLS": {
"IM": "",
"RDDTLS": {
"INDT": "",
"INDDT": ""
},
"PREDTLS": [
],
"CODTLS": [
]
},
"ADDDTLS": [
]
}
}
—Expected OUTPUT
{
"ESTDATA": {
"TITLE": "Testing",
"DESCRIPTION": "Testing Json",
"VERSION": "",
"CURRN": "",
"TRANDS": {
"ATRANA": "ABC",
"ATRANB": "TEST",
"SERV": "N",
"kTYP": "N"
},
"DOCS": {
"TYP": "KTY",
"NO": "1230001230343",
"DT": "20/11/2020"
},
"ITEMLIST": [{
"SLNO": "000010",
"DESC": "TEST 1 LTD",
"SERVC": "N",
"BAR": "",
"QTY": 1.0,
"ATTDTL": []
},
{
"SLNO": "000020",
"DESC": "TEST 2 ABCD LTD",
"SERVC": "N",
"BAR": "",
"QTY": 1.0,
"ATTDTL": []
}
],
"KCLDTLS": {
"IM": "",
"RDDTLS": {
"INDT": "",
"INDDT": ""
},
"PREDTLS": [
],
"CODTLS": [
]
},
"ADDDTLS": [
]
}
}
12-03-2020 11:47 AM
The expression from this post will help you remove all the null/blank values