1

I'm trying to drop more than one fields at once in QGIS 3 modeler on Microsoft Windows. I'm using the algorithm "Drop field(s)".

What is the good syntax to list multiple fields to be dropped?

Not working:
'Field1','Field2','Field3'

"Field1","Field2","Field3"

When I run it, I get a python error and the result is empty, no column at all.

enter image description here

enter image description here

enter image description here

enter image description here

3

You need to separate them via semi-colons:

field1;field2;field3
0

The way to discover that by yourself is to launch the algorithm from the toolbox (not from modeler), set some fields to drop:

select many fields to drop

Then, after you ran the algorithm, check the log, you will see the way that the toolbox generated the list:

list of fields as a python list

So it seems to be a python list, so you can write

['Field1','Field2','Field3']

Side note, I agree, this could be added in the help.

  • I tried the same thing, but the syntax shown in the log does not match what is required, ";" works though – Kapanther Nov 14 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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