I am using QGIS print composer. I have so many images to export with a specific label. The text of the label is existing in a field of a layer.
I have tried to use this expression attribute( get_feature( 'Metro_Ring','S','1'),'Route')
but the result is NULL.
where:
Metro_Ring --> name or ID of the table
'S' --> the field for selection.
1 --> the value that selects the row of interest.
'Route' --> the name of the field of interest.
I wonder if there is any error or a different method to get the value of the field 'Route' in the label.
1
) - without using quotes as that might suggest it is a a string. Also, all layer and field references here are case sensitive so make sure they match.get_feature('Metro_Ring','S',1)
expression - does it return NULL or<feature : 0>
(or some number other than 0)? If it's NULL then either the feature doesn't exist or you still have the layer/field reference wrong (maybe there is a trailing space in the layer name? Note this is the layer name in QGIS, not necessarily the filename)