Select to view content in your preferred language

Convert Model (from Model Builder) to Web Page

4182
3
03-19-2015 05:28 AM
BrianO_keefe
Regular Contributor II

I work with our local police department to update the Sex Offender web map on a (fairly) monthly basis.

What happens is as follows:

  1. The Officer responsible for maintaining this data updates the Shapefile of Offenders
  2. They save it to a specified folder and open a service ticket requesting the map be updated
  3. The service ticket arrives in my e-mail
  4. I double click the MODEL I built in Model Builder
  5. The Model asks for the location and name of the updated Shapefile
  6. I copy-n-paste the URL from my Ticket to the Model
  7. It truncates the current Offender SDE database table
  8. It appends the new Shapefile to the SDE database table
  9. I close the ticket and am done

What I would LIKE to do and just don't know where to start with this is... take my model and convert it to a Python script. Then SOMEHOW (and this is where my question comes in) offer a web-front / web-form where the officer INSTEAD of opening a Service Ticket, just opens a web page... pastes the URL to the updated Shapefile (or uploads the Shapefile?)... and hits DONE and it runs my script using that URL to the Shapefile (or the uploaded Shapefile) and updates the database.

Once the database is updated the updates propagate smoothly to the web map.

Has anyone done anything like this already? Convert a Model to a Web Form?

3 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Brian,

If you have ArcGIS Server, you could publish your model as a Geoprocessing Service, and then use Web AppBuilder to create an application that uses this service.  The police department could then access the application and use the GP service to upload the shapefile.

BrianO_keefe
Regular Contributor II

Jake Skinner​,

So I have a single model parameter. It is the UNC path to a folder where the officer saves out his shapefiles.

\\servername\folder\folder\sexoffenders\shapefilename.shp

The other parameter is the server with the current data which get's truncated in order to be ready to be populated by the newly updated data. I keep getting...

Failed to execute. Parameters are not valid.

ERROR 000735: Server : Value is required.

Failed to execute (UploadServiceDefinition).

I am confused. Any ideas?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Try setting one parameter for your model.  This will be for the input shapefile.  Ex:

Export Graphic.png

Save and close the model.  Then, run the model and specify an input shapefile.  After the model completes, go to the Results window > right-click on the tool > Share as Geoprocessing Service.  After the tool publishes, try running the tool as a GP Service in ArcMap to make sure it is working correctly.