Forum Discussion
As I can see from the first screenshot, seems to fails on JSON Parser Snap. So, it looks like that the message being sent from the system is not valid JSON.
- bojanvelevski3 years agoValued Contributor
Hi @KTsnap,
I believe this expression will do the job:
$group.map((x,index)=>$['@id'] == index + 1 ? (x.mapValues((v,k)=> $col.find(e => e['@id']-1 == x.keys().indexOf(k)) != null ? $col.find(e => e['@id']-1 == x.keys().indexOf(k) ).get('$') : v)) : x)
It’s rather complex, so I would suggest you to do some testing.
Regards,
BojanHi @bojanvelevski similarly if i have two array called row and group as shown below
I need to replace the the value of second array ie group array with values from first array ie row array
to elaborate->row id in first array (row array) is corresponding to first record in second array(group array) and colid in first array(row array) is corresponding to A, B, C,D,E,F,G,H,I in the second array(group array).Example:first record of second array(group array) with values corresponding to column B and C must be updated with value ($) corresponding to first array(row array) with row id 1 and col id is 2 &col id is 3but remaining column values like A,D,E,F…I values should remain as incoming input valuesExpected output is as shown below
Please could u help telling how can we achieve this using mapper expression here
- bojanvelevski3 years agoValued Contributor
If my understanding is correct, this is the same situation, isn’t it ?
You just need to tweak the expression a little bit.