12-07-2017 08:14 AM
I have a case where many fields may have to be excluded from mapper output, as if they never existed, selectively during a run. I am going to a cloud instance of a routine that will take null values in, and display them, or may delete wanted values, if this is not implemented correctly. Is there some way of implementing a way to selectively disable/enable the “target path” declaration on a mapper, while it is running? I even tried passing all nulls, and it doesn’t work.
12-08-2017 08:55 AM
You need to put $
in the target path so that the result of the cleanupTree()
function is used as the new output value. The ‘Pass Through’ option should also be unchecked. Without $
in the target path, lib.objutil.cleanupTree($)
is treated as the JSON-Path to delete.
12-08-2017 10:30 AM
THANKS, that did it! I thought I had tried the “$” as well, but it works now. THANKS!
04-23-2019 07:24 PM
Did anything happen to cause this to break? It doesn’t seem to work anymore.
06-23-2023 01:57 AM
I have a similar issue, but this expression library is not working.
12-07-2017 03:14 PM
For your specific Address example, I found this expression to work:
$Address.filter((v1,k1)=>!v1.value.filter((v2,k2)=>!v2.isEmpty()).isEmpty())
Logically, it also works like this:
$Address.filter((v1,k1)=>v1.value.filter((v2,k2)=>v2.isEmpty()).isEmpty())
No recursion though, so @tstack’s solution is definitely a better approach if that’s required.