I would like to know, how I can see the code behind a attribute field in the attribute table of a shapefile layer in QGIS 3.16. I have created a new data column with a specific code used in the field calculator. However, now I want to copy that code and use it for creating a new field in another layer.

  • I edited the question. Thanks for your comments Feb 28, 2022 at 14:14

1 Answer 1


You can't see which expression was used to create/change a field via the attribute table. But you may expand the latest dropdown in the field calculator where the last 10 to 20 expressions you used are listed.

  • 2
    And when/if you create a virtual field the formula is available in field properties (layer properties / field tab)
    – J.R
    Feb 28, 2022 at 14:45
  • Thanks for your suggestions. Somehow laborious that created expressions for fields cannot be seen for each field individually, but your comments definitely helped a lot. Feb 28, 2022 at 16:18
  • @Kevin_S2021 if you're running the same workflow with the same expressions over and over, you may create a model.
    – Erik
    Feb 28, 2022 at 16:28

Your Answer

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

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