cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to generate json format as per maximo target requirement

Precy
New Contributor

I have an input in below format:

image

which i need to transform into a json structure like below in order to load the asset to maximo, where highlighted ones are part of column list in input file and its corresponding value is to be saved in ALNVALUE column

image

I am not sure how to achieve this, can somebody help me with this?

2 REPLIES 2

Precy
New Contributor

When i tried with below logic i get output as follow:

jsonPath($.mapValues((value, key) => { ALNVALUE: parseFloat(value) || value, ASSETSTTRID:key}), “$*”)

image

which is not completely correct, i want highlighted assetnum, siteid, classstructureid outside the json path as mentioned in mapper snap.

image

Seems like i am missing somewhere a bit.

skatpally
Former Employee

$.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)