Am 18.04.2016 um 21:18 schrieb Piotr Kania:

> Can someone explain how to adjust it? It should select all clicked 
> values in attribute table

This one works for me:

# action 'Set selection by attribute value (NumContrib)'
fdname = u'NumContrib'       ### change to your attribute's name
idLayer = u'[% @layer_id %]' ### don't change
fid = [% $id %]              ### don't change
layer = QgsMapLayerRegistry.instance().mapLayer(idLayer)
f = layer.getFeatures(QgsFeatureRequest().setFilterFid(fid)).next()
NIF = f.attribute(fdname)

#selecao per atributo
sFilterExp = u'"{}" = \'{}\''.format(fdname, NIF)
it = layer.getFeatures(QgsFeatureRequest().setFilterExpression (sFilterExp))
layer.setSelectedFeatures( [f.id() for f in it ] )


_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to