Hi Nicolas, I think at the moment there is no way to achieve that without explicitly stating the layer id or name in the expression itself, since the layer is not known to the expression. This will probably change soon with the introduction of the "Expression Context" work by Nyall Dawson.
If it is an option for you to specify the layer name, you can use the map layer registry to find the layer and then use the dataSourceUri of the provider of this layer to find the file name. Regards, Matthias On 06/18/2015 09:39 PM, Nicolas Cadieux wrote: > Hi, > > I need to use the field calculator to add the file name or layer name to a > new field. Is there an expression for that? If not, can someone help me > with the function Editor? > > Thanks > > Nicolas Cadieux M.Sc. > Les Entreprises Archéotec inc. > 8548, rue Saint-Denis Montréal H2P 2H2 > Téléphone: 514.381.5112 Fax: 514.381.4995 > www.archeotec.ca > _______________________________________________ > Qgis-user mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-user _______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
