Nice use case for Layer Actions. [![enter image description here][1]][1] Just configure a new layer action like this: [![enter image description here][2]][2] Code for the layer action: <!-- language: python --> from qgis.core import QgsProject from qgis.utils import iface field_name = "etiqueta" # CHANGE THIS TO YOUR OWN FIELD NAME layer = QgsProject.instance().mapLayer("[% @layer_id %]") idx = layer.fields().indexOf(field_name) if layer.selectedFeatureCount(): params = QgsAggregateCalculator.AggregateParameters() params.delimiter = ',' value = layer.aggregate( QgsAggregateCalculator.StringConcatenateUnique, field_name, params, fids=layer.selectedFeatureIds())[0] for fid in layer.selectedFeatureIds(): layer.changeAttributeValue(fid, idx, value) iface.messageBar().pushSuccess("Concatenate unique", "Done!") else: iface.messageBar().pushInfo("Concatenate unique", "First select some features...") -------------------- Notes: + You just need to change the `field_name` variable to match your field name and you're done. + The layer action will be available in editing mode. It won't be saved until you click on `Save Layer Edits`. [1]: https://i.sstatic.net/AZm1h.gif [2]: https://i.sstatic.net/XPNrB.png