Hey everyone!
I've been working on a custom geoprocessing tool.
Users select one or multiple polygon features from the map widget using either a Filter widget or using the Select tool in the map widget. The idea is for the filtered features to be an input parameter in the custom geoprocessing tool-- the filtered records are used to build a query for a database on our server. However, while the filters SEEM to work (the count of features for the layer reflect what's visible in the map widget with the selections/filters applied), the filters DON'T actually apply -- it's not passing the filtered information, just the whole feature layer every time.
I've tried the action buttons --> set as analysis input as a workaround, but it doesn't work if the user selects multiple polygons (no pop up comes up, no pop up means, no action buttons, no "set as analysis input" option). For a single polygon, Set As Analysis Input does work, but a large part of the use of the tool is the ability to run analyses for multiple polygons. I've considered trying to replicate what Set Analysis Input does (create an in-memory feature set somewhere once the filters are applied), but I'm not sure that's the right place to start. Alternatively, maybe finding a way to access the query the filter the map and filter widgets generate and using that to build my downstream query?
All I really need is a way to pass information on what records are selected in the map pane to my tool so I can build my query somehow-- I'm confident I can handle the rest. But I'm really stuck on this step!
Hi, thanks for your feedback!
We are working on to improve the expoerience working with data selection in Analysis.
But for now, regarding to your comment: "but it doesn't work if the user selects multiple polygons (no pop up comes up, no pop up means, no action buttons, no "set as analysis input" option). ", yes the data action from popup only allows you to pass single selection.
I think the workaround is to use Select widget, which allows you to select multiple, and from the selected record you also use the same data action "Set as Analysis input" to pass all the selectiobs.
Or you can add a Table widget, after you select multiple features on map, from Table you use the Data action -Selected records- Set as Analysis input, to pass all selections to the Analysis
Thanks for your response! Exciting to hear you are working on this.
I agree the table widget is probably the best way to go with current capabilities. Ultimately the team I built the tool for was not happy with the amount of clicks required to get from map or table to tool input. People familiar with ESRI's webmap or pro interface generally expect to be able to select from the map, and found the extra steps really counterintuitive.
I ended up adding workaround to the tool. Users filter the map view using the map select tool (with view filtering enabled) or a couple of other filter tools (by date, region, etc), then add the layer as the tool input. I then wrote code to pull out the "filter" argument (a SQL query) out of the server arcgisjobs/custom_webtool/jobid/definition.dat file generated when a job is submitted, then applying the filter to the layer on the server to continue the workflow with just the filtered selection. It works but is definitely a little bit crazy!