I am trying to replace numerous attributes in a target layer from a source layer. The Transfer Attributes tool does exactly what I need on a single polygon at the time, but I need to do it on every record. The target has several fields that are not shared, but I need the rest to update. In our legacy workflow, I would have used an update query in the database itself, but within Pro is there any way to do this? There doesn't seem to be a batch option for this tool.
Is python an option? I use a dictionary approach described here.
Joe,
Python is definitely an option, but I was struggling to figure out how to go about it. Thanks for responding. That dictionary method could work, but the number of fields would make it pretty laborious. With other tools previously, I have modified them to run as a batch, but for some reason this one doesn't seem to do that.
Are the layers accessible via a Service, or are you working locally on file-based resources? The ArcGIS Python API may be helpful here, but mainly if you can take advantage of the edit_features function on a feature service.
I'm working locally. Both layers are in a file geodatabase. When we used Personal Geodatabases, I would have just written an update query in Access. I am still developing the new processes, and this is one of the only issues left.
I am fairly certain it will have to be written in Python, but it just seems like there would be a pre-built tool for it.
Ah, boo. It would be a fairly simple matter if you could take advantage of Spatially Enabled DataFrames, but I try to stay away from ArcPy cursors as much as I can, we don't get along.
Do the records in your two tables line up on an attribute?
Could you: Create an ad-hoc join → batch field calculate the target attributes → remove the join?
I haven't tried that since I moved them both into the same gdb, but the other day I tried doing it while one was a WFL, and it hard crashed Pro. I hadn't thought to try it again since I moved things around though. Good thinking.
The whole point of the dictionary approach is to avoid a join. I done it dozens of times on thousands of records/updates. But do what you feel works for you.
I mean, the batch field calculator really wouldn't even need the join in place if the expression were written correctly. But I'll have to give it a shot next time a situation comes up that might need it. I'll never learn how to use the arcpy cursors if I keep avoiding them...
I agree Joe, but given that this is 114 fields on thousands of records just in this one example (more on other datasets), I probably need something the whole team can use and understand though. I would still like to find a more elegant solution. I'll update here if I find something.