I want to add a new field named 'TEST' to an existing attribute table (SHP) using Refactor Fields, but when I want to save as new shape, it says:
Evaluation error in expression ""test"": Column 'test' not found
Of course it's not found, since I want to add it as a new field!
Anyone a clue?
It happens both with versions 2.14 as with 2.18
2 Answers 2
The Refactor Fields tool is useful for reordering the fields that you have already created.
For solving your issue, I think you should use the Add field to attributes table algorithm, available from the Processing Toolbox:
-
1Thanks a lot! But then the "add field" button in Refactor Fields should be removed I guess to make things clear. Thanks again!Rob– Rob2017年04月29日 18:16:08 +00:00Commented Apr 29, 2017 at 18:16
-
If I want to add 20 new fields, do you know whether I have to "save as" the attribute table 20 times too?Rob– Rob2017年04月29日 18:18:10 +00:00Commented Apr 29, 2017 at 18:18
-
@Rob I'm glad it was helpful! If you want to 20 new fields, why don't you do it directly from the Attribute Table? Or are you working with a python code?mgri– mgri2017年04月29日 18:32:16 +00:00Commented Apr 29, 2017 at 18:32
-
1Yes, thanks! That's what I will do; the reloading takes so much each time in between though. Thanks again!Rob– Rob2017年04月30日 10:11:43 +00:00Commented Apr 30, 2017 at 10:11
You could just add new columns by opening the attribute table in edit mode and use the 'Add new field' icon (or just Ctrl+W
)
Then use the Refactor fields
to reorder them as you want.
I have also found the Refactor fields
not to work for adding a field.