enter image description here

I want to add text label in "print composer" with that column's name.

Is there any expression to return that field name?

  • You may want to look at this question, it seems to be similar : link – J.R Dec 7 '17 at 15:20

Unfortunately there is no direct way to add the field name into map composer in QGIS, but as a workaround you can do the following steps:

  1. Create a new group in the legend
  2. Drag the layer that you want and put it inside the group
  3. Rename the group with the layer name or any desired name
  4. Rename the layer name with the Field name

You can see the process in the animated image below:

enter image description here

| improve this answer | |
  • So sad...but thanks to kind gif answer!! Then, is there way to add just text (not that legend title) with function as like "$currentfeature" or Variables's function?? I got the "project name" by using " [% layer_property( 'traffic','name')%]" but, i can't find the way to return a column's name. – user109635 Nov 23 '17 at 1:34
  • Unfortunately, No. The layer_property() function returns only what it is stored in the metadata of the layer. It does not access the attribute table, and I am not aware of any function that can return the text of the column name. – ahmadhanb Nov 23 '17 at 3:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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