Forum Discussion
The Mapper can delete fields based on a JSON-Path and you can do quite a bit with JSON-Path. If you wanted to delete fields whose values were null, you could add a Mapper, set “Pass through” to true, and add one row with this expression:
$…[?(value == null)]
Note that there is nothing in the ‘Target Path’ column for this row.
Here’s a breakdown of the JSON-Path:
$… - This tells the mapper to walk the entire JSON object hierarchy.
[?(value == null)] - This is a conditional that tells the mapper to visit only those fields whose value is null.
Is there a way to get tims method to work on the entire reference?
We start with:
, {
“value”: {
“AddressType”: {
“value”: null
},
“AddressLine1”: {
“value”: null
},
“City”: {
“value”: null
},
“StateProvince”: {
“value”: null
},
“Zip”: {
“value”: null
},
“Country”: {
“value”: null
}
}
And want nothing to appear.
Tim’s method gives us:
, {
“value”: {
“AddressType”: {},
“AddressLine1”: {},
“City”: {},
“StateProvince”: {},
“Zip”: {},
“Country”: {}
}
a new error
{“response_map”: {“error_list”: [{“message”: "Request to login.microsoftonline.com failed authentication: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: b2e03ecc-49a0-4023-a68c-f20007d5c100\r\nCorrelation ID: 2ef4b658-77fa-48d2-ad3c-9c8596c8a08d\r\nTimestamp: 2021-09-14 14:35:52Z","error_codes":[7000215],"timestamp":"2021-09-14 14:35:52Z","trace_id":"b2e03ecc-49a0-4023-a68c-f20007d5c100","correlation_id":"2ef4b658-77fa-48d2-ad3c-9c8596c8a08d","error_uri":"https://login.microsoftonline.com/error?code=7000215\“}”}]}, “http_status_code”: 500}