Hi,
I have a requirement to remove attributes with null values from a cdt, so that downstream system can consume it properly.
Given: {a:null, b: 10, c: "", d: 20}
Expected: {b: 10, d: 20}
Please let me know if there is an easy way to do this.
Discussion posts and replies are publicly visible
The toJson() function is used to remove null or empty values. When you set it to true, it will exclude or remove the null values from your array or data. After that, you can convert the Json data back to a standard dictionary format using the a!fromJson() function. Here am adding a snippet for your reference