Auroth
3 months agoNew Contributor
Trying to 'flatten' array using a mapper and pull out values
Hi Everyone, I am trying to pull the 'TDLINE' elements out of the weirdly structured array shown below. Normally for something like this I would use a .filter() with a .map() - something like the following. .filter(x => x.get('TDFORMAT') == '/').map(x => x.get('TDLINE')).
However, running the code above gives me an error about how a list type does not have the function '.get()'. I presume this is because of the weird structure of the array above -- or maybe it's being stored as a list, which maybe is different than the array?
Anyways, I am just trying to pull out all the TDLINE elements and get them into an array where I can then push that out to an endpoint later. Does anyone have any ideas on how to do so?
Thanks in advance