I would like to get an array with IDs of all selected features of layer 'LayerB' (field-name: "id_of_layerB"
) as a default value in a QGIS Attribute form of 'LayerA'.
I tried something like:
aggregate(layer:='LayerB',
aggregate:='array_agg',
expression:= "id_of_layerB",
is_selected('LayerB', ???)
)
but I have no idea how to realize this (especially what to put in the ???
-part of the expression part of the code.
I think, the is_selected()
-function checks agains just one feature, but is there a way to get ALL (one or more) selected features of 'LayerB'?