I have a layer where I had 6 polygons. I then used the field calculator so I could get a column with the area of each of these polygons and I thought this would be applied to any other polygons I made after that, which was not the case since every new polygon appears as "NULL" in the area column. How do I make so the area is calculated automatically for all the rows?
You can use the AutoFields plugin, which solves exactly that issue.
Go to the plugin's docked window, select your polygon layer, choose the
'Area' field from the list of existing fields, choose the expression
'Area' and click on
Now QGIS will maintain your
Area field up-to-date when you create new polygons or edit existing ones (you can also calculate the expression on already existing features if you like).
The AutoFields plugin saves the Area data into your data source file, so you can see it even if you change the QGIS project or load the data into another GIS software.
Watch this demonstration video showing how to keep other geometric properties up-to-date.
There are 2 approaches:
1/ select all area's which has no value ("Area" is null) and do the calculation just on the selected ones. Check 'only update XXX selected features' and 'update existing field'
2/ You can make a virtual field with the expression $area. Every time you add a feature the area will be calculated. Warning: a virtual field is project only. If you want to distribute the shapefile to another, you have to save it as a new one.