Select to view content in your preferred language

Cannot get Assignments through ArcREST script

752
0
10-20-2016 01:45 PM
KeithAnderson
Occasional Contributor

Thought I would try exporting my Workforce data as my first test with the ArcREST scripts. I can authenticate but cannot return Assignments. Below is the Python logging. I have tried many 'Where' clauses. Thought I would leave it out so it would default to 1=1. Same results each run. Any suggestions welcome.

C:\Windows\system32>"C:\Program Files\ArcGIS\Pro\bin\Python\python.exe" c:\ArcREST-master\samples\arcrest_scripts\export_assignments_to_csv.py -outCSV "./exported_assignments.csv" -u xxxxxxxxx -p xxxxxxxxx -url "https://xxxxxx.maps.arcgis.com" -pid "7c71c4452d444d5996c326c01867f036" -logFile "./log.txt" -outSR 10200 -dateFormat "d/Y"

[2016-10-20 15:20:43,614] [  export_assignments_to_csv.py: 116 - main()]         [MainThread] [      root] [    INFO] Authenticating...
[2016-10-20 15:20:45,782] [  export_assignments_to_csv.py: 119 - main()]         [MainThread] [      root] [    INFO] Getting assignment feature layer...
[2016-10-20 15:20:46,200] [  export_assignments_to_csv.py: 159 - <module>()]     [MainThread] [      root] [CRITICAL] Exception detected, script exiting
[2016-10-20 15:20:46,202] [  export_assignments_to_csv.py: 160 - <module>()]         [MainThread] [      root] [CRITICAL] 'assignments'
[2016-10-20 15:20:46,205] [  export_assignments_to_csv.py: 161 - <module>()]         [MainThread] [      root] [CRITICAL] Traceback (mostrecent call last): |  
File "c:\ArcREST-master\samples\arcrest_scripts\export_assignments_to_csv.py", line 157, in <module> |     main(args) |  
File "c:\ArcREST-master\samples\arcrest_scripts\export_assignments_to_csv.py", line 120, in main |   
assignment_fl = workforcehelpers.get_assignments_feature_layer(shh, args.projectId) |  
File "c:\ArcREST-master\samples\arcrest_scripts\workforcehelpers.py", line 73, in get_assignments_feature_layer |    
return arcrest.agol.FeatureLayer(project_data["assignments"]["url"], securityHandler=shh.securityhandler)
| KeyError: 'assignments'

0 Kudos
0 Replies