Looking for help with the Convert Attachments tool

424
3
04-14-2020 10:30 AM
ErikLeigh
New Contributor III

I am trying to build a shortlist story map and running into some problems I'm trying to work around.  Hopefully this all makes sense to somebody.

I want my maps to be dynamically populated based on data received from public surveys through survey123.  These surveys have the option to include pictures that are apparently stored as attachments and are not part of the normal table.  So in order for the shortlist to recognize the pictures then I have to either manually move the pictures over to a specific picture field, or use something like the convert attachments tool.  I want the map to stay as updated as possible so I would like to eventually have windows task scheduler run some python scripts to update this data once or twice a day.   

I'm not good with python, but I've managed to get the tool box loaded into arcmap and can run the tool from there. Any help with explaining how to run this tool from windows task scheduler would be great as well.  I've tried running it outside of arcmap in command prompts and python command line, but no luck so far.  If you also happen to know of any good guidance on how to adapt the python script to perform other updates, such as run a calculated field, then that would also be useful.

Unfortunately, I keep getting various errors when I try to run the tool. Sometimes I get token errors, which I don't understand.  Often times I get errors saying I don't have attachments, but I think I do.  So anyways, looking for somebody that can help me trouble shoot this thing please.

My last error message.

Executing: AttachmentstoPopup false true false # # # https://services3.arcgis.com/juqcZ3KnfEqg8N1S/arcgis/rest/services/survey123_22525a308de24da4b7d963e5a7cd8b90/FeatureServer PIC_URL

Start Time: Tue Apr 14 09:00:16 2020

Running script AttachmentstoPopup...

Feature service does not contain attachments

Completed script AttachmentstoPopup...

Failed to execute (AttachmentstoPopup).

Failed at Tue Apr 14 09:00:17 2020 (Elapsed Time: 0.98 seconds)

Thanks for any ideas!

Erik Leigh

Jake Skinner

0 Kudos
3 Replies
JakeSkinner
Esri Esteemed Contributor

Hey Erik,

One issue I see is how you are specifying the Feature Service URL.  You will want to add the index of the layer at the end of the URL (i.e. /0😞

https://services3.arcgis.com/juqcZ3KnfEqg8N1S/arcgis/rest/services/survey123_22525a308de24da4b7d963e...

If this still fails, can you send a screen shot of how you have the tool setup?

0 Kudos
ErikLeigh
New Contributor III

Thanks Jake. Adding the index layer helped. The tool worked just fine. I login to arcgis through an enterprise login. So far I’m just sharing the layer public and then running this script when I want. However, I want to eventually make it an automated process through windows task scheduler. Is there a way to go about the login process with your script and can you recommend a guidance to get that script running? I’m also wondering if it’s not to hard to use the same script to run a calculated field so it also updates.

Thanks for the help!

Erik

0 Kudos
JakeSkinner
Esri Esteemed Contributor

You can use ArcGIS Pro to schedule any tool, model, or script tool:

Schedule geoprocessing tools—ArcGIS Pro | Documentation 

Also, here's a link on how to schedule a python script using Task Scheduler:

https://community.esri.com/docs/DOC-14675-schedule-a-python-script-using-windows-task-scheduler 

However, I recommend the former, using ArcGIS Pro, to schedule a script.

0 Kudos