How to import values from 'label' in symbology window to showing them as particular labels (QGIS 3.22)? I suppose it can be done with some short, clever expression in labelling window.

enter image description here

  • Are you ok with setting this only once or do you want it to dynamically change based on the rule-based symbology?
    – kowalski
    Commented Oct 3, 2022 at 8:17
  • @kowalski yes - I'd be okay with setting this once but it would be much better to see dynamic change in labelling.
    – Adam
    Commented Oct 3, 2022 at 10:37

1 Answer 1


You can achieve half of it.

Go to the rule based symbology, select every rules, right click, copy.

Go to the label options, select rule based, right click, paste.

Doing this copies every rules, and sets the description to the "label" value from the symbology.

And here comes the manual, boring task that could be scripted if need be: For every label rule, click and

  1. check the labels box
  2. copy the description to the label-value

enter image description here

  • Thank you for the solution! What's important: my aim was to get name of the column (cat in your example), not the value (1 in your example) - in this way you have to add single brackets.
    – Adam
    Commented Oct 9, 2022 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.