I am using a bit of Python code to create an attribute table field and then I want to populate that field with the layer's datasource.
I have been using addField management and then calculateField management but I don't know how to reference the datasource so I can have it entered into this field.
This is the key bits of the expression:
inFeatures = "feature" #references the feature in the mxd inFieldName = "fieldname" #references the field in the feature attribute table expression = ***this is where I am stuck*** arcpy.CalculateField_management(inFeatures, inFieldName, expression)
It works if I enter a literal string as the expression but I want it to reference the datasource for the feature.