4

So I have a buffer layer with an associated attribute table. This table has a column called "value" that I want to change to "x" based on previous selection. I can select the buffers in the layers I need to edit, but I don't know how to edit the values of the attributes of the selected buffers.

How can directly edit attribute values at a specific column from the graphical modeler?

enter image description here

2 Answers 2

4

Use the Field Calculator algorithm.

enter image description here

There doesn't appear to be any documentation for this algorithm, except for this. But it looks like it works like the regular Field Calculator. Choose a layer from the dropdown menu, type in the name of the field you want to modify, choose 'no' as the option for Create new field, and type in the expression you want to use to modify the field. If you need help writing the expression, use the help available in the regular Field Calculator.

2
  • Is there any way of doing this without creating a new layer? I just want to edit an existing layer.
    – Steffan
    Commented Dec 10, 2018 at 10:39
  • What do you mean? In a graphical modeller you pretty much go through the steps with a new layer at every step. Commented Apr 7, 2022 at 14:23
0

You can use the Refactor fields tool for this.

Here I loaded the existing fields from the 1111 layer and then:

  • Convert the type of the field "status" to string
  • Add a new field "new_field" with the static value 'hi'
  • Add a new field "km_str" with the value of the "km" field converted to string

enter image description here

Your Answer

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

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