Forum Discussion
adam_gataev - you have the right terminology. Just use a Mapper as follows:
Here I'm just using two Array methods: concat() and pop() to complete your goal in one expression. The Array.pop() removes the last element and returns that element. The Array.concat() creates a new array with the new element added in.
Note that I'm also using the "pass-through" option on the Mapper settings. This allows any other elements in the input doc to flow through to the target path without specifying them.
Hope this helps!
You're the man koryknick, thank you so much!
When i tried with below logic i get output as follow:
jsonPath($.mapValues((value, key) => { ALNVALUE: parseFloat(value) || value, ASSETSTTRID:key}), “$*”)
which is not completely correct, i want highlighted assetnum, siteid, classstructureid outside the json path as mentioned in mapper snap.
Seems like i am missing somewhere a bit.
$.mapValues((value, key) => key==‘IsCritical’ || key==‘maoup’ || key==‘diame’?{AnnalValue:value,ASSETSTTRID:key} : “”).values().filter(x=>x!=“”)
Ignore the field names. Sample_2020_09_02.slp (3.7 KB)
Related Content
- 3 months ago
- 10 months ago
- 3 years ago
- 5 years ago