In a QGIS model, I have an input layer
polygon from which a grid is created.
On this grid-layer, a new attribute field should be created based on an expression that refers to the input layer
polygon. That works well as long as I set a fixed name for the layer
polygon - see the expression and the model linked here (at the bottom).
Basically, I just have to replace
'polygon' in the
overlay_intersects-part of the expression in a way to refer to the model's input layer:
overlay_intersects('polygon',$geometry) works, as long as the layer indeed is named 'polygon', but the model should be flexible to take the selected input layer here.
How can the layer-name be defined so that it refers to the name of the input layer, regardless of its name?
What I tried
In the field-calculator dialog, I select
pre-defined value and try to set my expression in 'single quotes' as described here in the style of:
'expression' || @loadpolygonlayer || 'expression'. For the layer to refer, I select it from the context variables as can be seen on the screenshot.