Bug report #20005

Fields to copy in 'Join attributes by field value' in processing modeler only works with one field

Added by Max Stephan about 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/Modeller
Affected QGIS version:3.2.3 Regression?:No
Operating System:MacOS High Sierra Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:Yes Copied to github as #:27827

Description

What I am trying?
  • Join two layers and copy only certain fields from layer 2
  • I am doing this in the processing modeler
  • I enter the field names in 'Layer 2 fields to copy', for example
    ['field1', 'field2']
Expected outcome
  • field1 and field2 are joined into layer 1
Actual outcome
  • No field from layer 2 is copied over
Assumptions where the error stems from
  • Every input into the field is treated as a string it seems. Looking at the log output from running the process I see for the algorithm that my input is transformed as follows:

Input:

['field1','field2']

Output:

'[\'field1\', \'field2\']'

I.e. it takes the whole entry as string and escapes the quotation marks. Not sure where things are going wrong. The algorithm works properly when just run on its own in the toolbox.

History

#1 Updated by Nyall Dawson about 6 years ago

  • Status changed from Open to Feedback

Try with a ; delimited list, no start our end brackets.

Eg

Field1;field2

#2 Updated by David Todd almost 6 years ago

Just tested the suggestion from Nyall and it functions as it should when using a

Field1;Field2

Would adding that piece of information to the doc here: https://github.com/qgis/QGIS-Documentation/blob/master/source/docs/user_manual/processing_algs/qgis/vectorgeneral.rst#join-attributes-by-field-value be appropriate?

#4 Updated by Nyall Dawson almost 6 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

Note that I also intend to add this in a Tokyo you on the setting, but for boring technical reasons this has to wait until 3.6

Also available in: Atom PDF