Extract selected metadata from ImageMarker Widget layer info.

Extract selected metadata from ImageMarker Widget layer info.

Hi All. 

As Image Marker seems to store a stack of info in a single Layer variable I'm trying to extract some of the data so an analysis can use it and write it to other variables. (I wish it just stored it all in the selected variable for that pin, it'd be much easier). 

So I've selected my analysis in the widget options "Run analysis when sending data". 

The scope returns this for each pin (and then the layer background image details on the end):
[{"id":"6354e27a3178370019453371","time":"2022-10-23T06:43:06.230Z","value":"Layer #1","variable":"layers","metadata":{"changed_pins":["6354e17845b4af0010ab9a38e5cb718100743a7cf0e56536"],"fixed_position":{"6354e17845b4af0010ab9a38ebb0441100144e5081e56536":{"device":"6354e17845b4af0010ab9a38","label":"4mm","link_type":"image","value":"4","x":"0.37387112958715596","y":"0.631347049689441"} 

It looks like changed_pins tells me which section of data was the most recent widget change which is good but how do I then query/select the changed pin ID data and how do I extract a specific value from it? Something like this?
const pindata = scope.find(data => data.variable.metadata. === "changed_pins");
const changedpinlabel = pindata.label;

Sorry for spamming the community a bit on these image marker and compose widgets, I'm slowly learning and finding work arounds to do what I'm after. 


        Take a look at our updated roadmap here!
          What would you like to see on TagoIO?