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)