I'm using QGIS 3.10.
I'm trying to label my map with values taken from a different layer (meaning not my atlas coverage layer), which is intersecting the atlas cover layer.
This layer named "Colorisé" has a categorized style using the field "color_id". I want my legend items to be labelled with the field "idprop".
I have tried using this expression (1), which returns the featured items not individually but as a list :
aggregate('Colorisé', 'concatenate_unique', "idprop", intersects($geometry,@atlas_geometry), ',', "idprop")
And I have tried using the expression below (2), which returns the first value it can find (I guess) and applies it to all my legend items :
attribute(get_feature('Colorisé', 'color_id', intersects($geometry, @atlas_geometry)), 'idprop')
Can you guys tell me if I'm anywhere close to getting the desired results ?
You can find below an excerpt from the table of attributes of the layer "Colorisé" and an image summing up the situation.
Using this expression seems to be working in the preview, but the labels end up being empty :
attribute(get_feature(@layer,'color_id', attribute($currentfeature, 'color_id')),'idprop')