Using QGIS 3.0 I have to draw a lot of features on the map and these features have attributes that change with each entry. However, there is a part of the attribute that is the same for all features. How do I automatically write this part of the attribute in the attribute table when creating a new point?
Example:
S1_00001
S1_00002
...
S1_0000N
The S1_
is always the same and can be in a different column as the serial numbering.
Answer
You can set the field default value.
Open the layer properties
, go to the field
tab and click on the field Text Edit
then set the default. Remember that text should be enclosed in single quotes.
You can also derive the value of a field based on other fields (if they all have a default). Assuming you have a column a
and b
you can set the default of column c
as "a" || "b"
(note the double quotes to refer to a field)
Now when you create a new features, the default will be used- and you are free to modify it or to keep it as is.
No comments:
Post a Comment