Select to view content in your preferred language

Python Script Not Working Anymore: Join + Field Calculate on HFC

566
1
09-17-2024 02:10 PM
Labels (3)
GIS_Consultant_ASE
Emerging Contributor

I have been using a series of Python scripts to update fields in a parent hosted feature layer by joining a related child hosted feature layer to the parent, and doing field calculation.  The goal is to get like "inspection" type data from the child layers pushed back up into the parent layer.  It had been working great, consistently.  I recently got a new computer and re-installed, and now it doesnt work.  In some cases, it runs successfully but no attributes are updated. In others, it just spins for a longer time than needed and nothing happens. Script is attached.

Some background:

The hosted feature layer is a group of 3 HFC with a 1:M relationship between parent and child.  The script only grabs the most recent records from the child layer to field calculate.  There are 3 other layers like this that I run scripts for, all of which had been working (just plugged in different Item IDs, HFC names, and field names into this same format.

Some things I've tried:

I am certain I have editing privileges.  The layer permissions have not changed.  I can edit in Pro, and have edited all this time before.  I added a script with lots of debugging, and it claims I dont have editing privileges but that is wrong.  I have also tried direct login instead of "Pro".  I have also ran the script from the python window rather than from the toolbox which I usually do.  All of it produces the same result of not changing anything.  I have verified that the key field upon which the join is based (GlobalID and ParentGUID) are all working.  

Some questions:

Is the script just no longer properly accessing AGOL because of the new software install? Did any new updates come down that may change this? Is there some environment setting I am unaware of?  How is this possible lol.  I appreciate any help I can get!

0 Kudos
1 Reply
KimOllivier
Honored Contributor

I am interested in your workflow. I do an identical task. I prototyped it in Pro and then moved it to a Notebook online. I could not use arcpy online, only arcgis so I found Pandas did help. If you get feedback that you don't have edit rights reported then I would take notice. I get this sort of thing, such as arcpy.Exists() not finding a file. Note that Esri has just completely revamped user roles, licencing, permissions. Have a look at the new system. Are you the owner of the FeatureLayers?

0 Kudos