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
If you are sending this info In API ,you can use the below
a!fromJson(a!toJson({ a: null, b: 10, c: "", d: 20 }, true()))
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
Inside the integration, there will be check box called "Remove fields with null or empty values from generated JSON". This will remove the null values from the JSON. This one can be used