[QGIS-Developer] QGIS expression to get internal ID of a feature in a related layer

Nyall Dawson nyall.dawson at gmail.com
Sun Dec 4 15:54:33 PST 2022


On Wed, 30 Nov 2022 at 00:06, Andreas Neumann via QGIS-Developer
<qgis-developer at lists.osgeo.org> wrote:
>
> Hi,
>
> I am looking for a way to find out the internal id of a related layer with a QGIS expression.
>
> @id and $id only work directly on the feature of the source layer, but not on related layers.
>
> attributes(
>    get_feature(
>       'Other Related Layer',
>       't_id',
>       fkey_value
>    )
> )
>
> doesn't contain the internal id of the other layer ...
>
> Any ideas how to get access to internal ids of other layers?

This is indeed a silly limitation -- we need a "feature_id(...)"
expression function!

Can you file a feature request for this?

Nyall


>
> Thank you and greetings,
>
> Andreas
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list