POST
|
I'm a novice at best with Python scripting but it's on the top of the list of things for me to figure out so our organization can more fully utilize Workforce. I've had success running the title script in the Python Command Prompt written like this: python create_assignments_from_csv.py -csv-file "N:\RDA_exported_assignments.csv" -u <username> -p <password> -org "https://<our org>.maps.arcgis.com" -project-id "<xxxxxxxxxxxxxxxxxxxxxxxxxxxx>" -x-field "xField" -y-field "yField" -assignment-type-field "AssignmentType" -location-field "Location" -description-field "Description" -priority-field "Priority" -wkid 102100 -log-file "N:\Rapid Damage Assessment\log.txt" -timezone "US/Pacific" Again, this worked. However I can't seem to get the same script to work in a Jupyter notebook. The sample notebook geocodes an address to an x,y location which I already have. My assignments csv does not have addresses, only x,y location in separate columns (exported from the Assignments Point Layer - see sample below) as the points are along river levees and don't necessarily have addresses, and i used the location field in Workforce for the name of the levee that is to be inspected. How do I get the script to recognize my x,y data? I've tried converting the x,y data into a single column titled SHAPE with formatting like this: {"x": -122.366238, "y": 47.22577965}. This seemed to work but as the script created the assignments, there was no symbology for the new assignments - similar to the discussion here: Workforce 'create assignments from csv' script - no assignments symbolized on map I'm really hoping to use notebooks rather than Command Prompt scripts so I can document processes and share more easily. I'm pretty sure I need to change at least the geometry line(s)? workforce-scripts/2 - Importing Assignments.ipynb at master · Esri/workforce-scripts · GitHub Below is a sample of the csv that works with the Command Prompt script. I know I can delete a lot of these fields, and please let me know if I should. OBJECTID xField yField Description Status Notes Priority AssignmentType WorkOrderId DueDate WorkerId GlobalID Location DeclinedComment AssignedDate AssignmentRead InProgressDate CompletedDate DeclinedDate PausedDate DispatcherId CreationDate Creator EditDate Editor 5 -13621747.3 5979005.241 Puyallup Left: MP3.0 - 6.8 unassigned high Levee Assessment - Drive Zone 1 e99c5014-0d2a-4a8b-9dab-278c052f703d River Road Levee 23CE0246-08E7-4E60-B6AC-49D9DFCF7F29 7/21/2020 11:40 dsarver 7/21/2020 12:21 dsarver I hope what I wrote makes sense, and thanks for reading this
... View more
08-18-2020
01:47 PM
|
0
|
3
|
1302
|
POST
|
Thanks for the reply Shwu-jing. The survey was published using version 3.7. I have 2 maps as linked content; the stakeholder feature service, and I added an additional web map as a reference. The survey was built from scratch (not from an existing feature service) but was a revision of an older survey. I did append the records from the old survey to the new (minus photos). This survey has become pretty high profile in our organization, has dozens of users across multiple divisions/departments, contains hundreds of photos (which in my experience are very difficult to append) and has an associated dashboard - and other than the issue I'm asking about - is fully functional. Rebuilding/republishing is probably not an option for us as this is really just an annoyance more than anything. When I have time I may test the workaround. I'd still be interested in a solution that doesn't require a rebuild though Thanks again!
... View more
03-04-2020
09:47 AM
|
0
|
1
|
471
|
POST
|
I've built a number of surveys over the past couple of years using Survey123 Connect. One of the surveys shows a blank map graphic on the data page when I click to review and/or print a record. The other surveys I've created don't have this issue. Any ideas?
... View more
02-28-2020
02:04 PM
|
0
|
3
|
533
|
POST
|
I finally figured it out! Here's what I ended up with: if((${total}>0 and ${total}<=12),"Unlikely",if((${total}>=13 and ${total}<=35),"Low",if((${total}>=36 and ${total}<=45),"Moderate",if(${total}>=46,"High",null)))) Thanks again for your help Stephen!
... View more
12-04-2018
07:40 AM
|
0
|
0
|
402
|
POST
|
Thanks Stephen! I had tried that and tried it again after your recommendation. The error I keep getting says "...XPath evaluation: cannot handle function 'if' requires 3 arguments. Only 2 provided. Any ideas?
... View more
12-03-2018
03:18 PM
|
0
|
2
|
402
|
POST
|
Hello. I've got a survey where I'm trying to calculate a numerical risk score and correlate that score to a risk level, e.g. low, moderate & high based on varying scores. Currently I'm able to calculate the score and use relevance to display the risk level on the survey, but I need to use the risk level (low, moderate, high) in reporting and Operations Dashboard. Is there a way to automatically select an answer to a select one risk level question based on a calculation? Or any other ways of accomplishing this? Thanks! Dave
... View more
12-03-2018
08:31 AM
|
0
|
4
|
575
|
Online Status |
Offline
|
Date Last Visited |
06-13-2023
07:05 PM
|