When rewriting two fields into one, the last value of the hidden field is repeated for all rows of the CSV. Confused yet? Here's an example from the Views configuration perspective:
Style: CSV Feed
Relationship: Institution (NodeReference)
Fields:
(Institution) node_id -> yields the NID of the institution; set to hidden
field_institution_ref -> CCK Node Reference Field; yields name of institution;
Settings for field_institution_ref:
Rewrite the output of this field -> [field_housing_inst_affil_nid] [nid:[nid_1]]
Expected Output:
Green Bay Packers [nid:123]
Jonestown [nid:456]
NATO [nid:789]
Produced Output:
Green Bay Packers [nid:789]
Jonestown [nid:789]
NATO [nid:789]
Notes:
I have the Feed attached to a Page display which shows the Expected Output.
I have also swapped which field is hidden and which is rewritten & used the field "(Institution) Node Title" instead of "field_institution_ref" with the same outcome.
Bonus: Views Export 6.x-1.1, Views 6.x-2.12, D6.20
Comments
Comment #1
kbk commentedHere's a workaround using Views CustomField that uses php to rewrite the fields.
Relationship: Institution (NodeReference)
Fields:
(Institution) node_id -> yields the NID of the institution; set to exclude from display
(Institution) node_title -> yields name of institution; set to exclude from display
Customfield: PHP code -> with following code
Produced Output:
Green Bay Packers [nid:123]
Jonestown [nid:456]
NATO [nid:789]
Note: Field names are simplified.
Comment #2
jenna.tollersonI believe this was fixed in #715770: The fields when assigned within global custom text returns only the last row. I had the same issue with 6.x-1.1 so I installed the latest dev and it produced the correct output.