I want to add multiple fields to my layer using the QGIS graphic modeler. I am trying to do this with the field calculator, but I ́m unable to add all the fields to the same layer. I always end up with multiple layers that have only one of the new fields.
Is there a way to add all the fields (I need 8) to the same layer?
2 Answers 2
Try Refactor fields. Make sure to include all existing fields (for example by pressing Load fields from template layer), then press Add new field, to add new fields
Although the question is a bit old, my answer may be helfpul to others.
Tested on QGIS 3.28.11.
You can skip the "load fields from template" or in other words, you can skip creating the template by using a cascade of "Add field to attributes table".
Important here is to set input layer as Using algorithm output starting from the second "Add field..." command