I am building a script that appends features from one layer to another however some of the fields that I need populated are not titled the same which causes them to stay null. How can I set the row in the update cursor command to equal the field from the original feature class? Code snippet below.

Original feature layer & field: mainLayer \ MainLineType

New feature layer & field: rLinesLayer \ FeatureType

Need to set "rLinesLayer \ FeatureType" (row[3]) = "mainLayer \ MainLineType" (circled in red)

code snippet

closed as off-topic by BERA, Midavalo Aug 2 '18 at 17:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – Midavalo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Welcome to GIS StackExchange! As a new user, please take the tour! In the future, please include your code as a formatted code snippet, not a screen print. – smiller Aug 2 '18 at 14:28
  • 1
    if you want to append new features, you need insert cursor. And if you don't update a row value, it will remain the same, so you simply use row[3] – radouxju Aug 2 '18 at 14:34
  • 4
    sorry, but I don't understand what you want to do. Maybe it is just my understanding of English, but it could help if you could edit your quetion and clarify what are your input and output. I think that the confusion comes from the word "append" (in arcGIS, the append command adds new features to an existing feature class) – radouxju Aug 2 '18 at 14:56
  • 2
    Also, look into field mapping options for the Append command. pro.arcgis.com/en/pro-app/tool-reference/data-management/… – smiller Aug 2 '18 at 15:49
  • 2
    It is still unclear what you are asking. Edit the question and explain why you cant use Append with field mapping. – BERA Aug 2 '18 at 16:21

Rather than using a two-stage process of append then update cursor, look into the Field Mappings option for the Append tool. The syntax may differ depending on your version; this is the link to the help page in ArcGIS Pro. Using Field Mappings will allow you to include data from columns that do not specifically match the new layer's field name.


For your existing dataset (already appended, just need to update a single field): Try to AddJoin, then CalculateField. These steps can be done as part of an arcpy process, outside of the cursor loop.

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