Select to view content in your preferred language

Pass parameters from html page to python script

441
9
Jump to solution
05-21-2024 12:03 PM
MikhaylaB
Occasional Contributor

I am being asked to come up with a solution that allows a user to set queries on a feature class and related tables from an app or widget and then export the results to an excel sheet. They want the records to be joined so they appear as one line item based on their common ID instead of separate tables. I can come up with the python to join and filter the tables, as well as export the results. The issue is, the users want to run this themselves and aren't familiar with python. My question is, does anyone have a suggestion for the user interface? Is it possible to pass their selections to the python script from an html page?

0 Kudos
1 Solution

Accepted Solutions
BlakeTerhune
MVP Regular Contributor

If not, Flask is probably what you want.

View solution in original post

0 Kudos
9 Replies
JeffSilberberg
Occasional Contributor III

Create a simple HTML Page/Form and use your Python as the SUBMIT handler -- 

Here is one of many hits from a simple google search to get you started -- 

https://www.tutorialspoint.com/How-to-process-a-simple-form-data-using-Python-CGI-script

 

MikhaylaB
Occasional Contributor

Thank you, I think this will work for me. I'm going to give it a shot.

0 Kudos
BlakeTerhune
MVP Regular Contributor

Do the users have ArcGIS Pro installed?

0 Kudos
MikhaylaB
Occasional Contributor

I think my main user has it installed but doesn't use it. 

0 Kudos
BlakeTerhune
MVP Regular Contributor

You could create a script tool or Python toolbox that runs inside ArcGIS Pro. Both give you a simple user interface and custom messaging.

MikhaylaB
Occasional Contributor

I actually proposed that idea to my boss, but it was turned down. I may try to push it again because I do think it is an easier option and the end user can be trained on it.

BlakeTerhune
MVP Regular Contributor

If not, Flask is probably what you want.

0 Kudos
JeffSilberberg
Occasional Contributor III

 

Sorry, I don't understand your question as it pertains to this thread.  

 

 

0 Kudos
MikhaylaB
Occasional Contributor

I'm working on a Flask app now to test on dummy data, and it seems to do what I need. This will be the solution once I get it working on real data.

0 Kudos