DOES IT EXIST
Has anyone already developed a custom Editor widget that includes functionality (GUI tools) to select one or more features (geometries) from one map/feature service and paste it into another feature service? For example, I don't want users to digitize polygon boundaries if those boundaries are available from another hosted service. Preferably the widget could be used with Web AppBuilder. Ideally, attributes would also copy over provided the field names/types are identical.
IF NOT, WHY NOT
This seems like functionality that would be in high demand, but it doesn't already exist in the Web AppBuilder Editor widget - so what are the limitations/constraints to including this kind of functionality? I've read several older posts for people customizing this functionality, and the API4JS docs seem to indicate that it's doable via cloning. Is it too difficult to allow configuration with template pickers, graphics and/or event layers, projection problems, client memory limits, read permissions limits, or something else?
Sorry for the misunderstanding. The script can be used to copy geometry and attribute values from one feature class to another provided it handles the any field mappings for attributes within the script. The 'featset' input variable gets its value from the feature that has been clicked on (regardless of which feature class it is part of - so long as geometry types match). The Featset then gives access to attributes and geometry so you can copy them to the output feature.
Hope that helps,
I am working on something very similar but must not have something correct in my python tool. What I am trying to do is have the user add a csv file to the web map using the Add Data widget. This widget will geocode some addresses and add the data as an operational point layer to the map. I would then like a geoprocessing service to copy this operational layer into an existing feature service. To simplify my process, I am currently trying to insert one sample feature layer into another (same schema), with no luck. My gp service was created from a simple python script, added as a script tool and the results published to ArcGIS Server from ArcMap 10.7. The tool runs perfectly from Arcmap, there are no errors when I publish, and there are no errors when I add the service to the gp widget in Web AppBuilder. Message level is set to "Info."
I based my script off of the one ahna.miller posted in December. This script uses a search and insert cursor. (I have also tried using the append tool) The tool parameter data type is Feature Set. This tool has two inputs with no outputs. Maybe the gp service could be having an issue with this as there is no output layer?
My source data is registered with the Data Store. Anyone have other suggestions?
No, I did not get this to work. I receive no error messages when publishing or running the tool with the GP widget in WAB. It does take the features selected by the Select widget and the GP widget. However, no output is added to an existing feature service. It makes me wonder if the edits are getting saved.
I found an AGOL widget that will do this process for me - hopefully will help most of you as well. The Smart Editor widget in web app builder allows you to copy polygons from one layer and copy to another, while copying over attributes (provided schemas are matching).
Allow user to create new features from existing features option
Copied feature values override defaults
Then click on New Feature, then from the drop down "Select features to copy" option in the tool and drag select the polygons you'd like to copy.