Hello everyone,
we have created a notebook in ArcGIS Online that creates a Word document based on various parameters. If we let the notebook run on its own, everything works. The output is written to the "arcgis/home" directory.
The next step would be to publish the notebook as a web tool in ArcGIS Online. To do this, we wanted to define an output parameter. The settings currently look like this:
A first question would be what we have to specify as a default value in JSON format. According to the documentation, it has to be a URL to an existing output? Currently, we have simply uploaded the Word template as an item in ArcGIS Online and specified the URL to it.
Afterwards we added this snippet at the end of the notebook:
The name of the variable equals the output variable name for the word file.
After publishing, we open the tool in map viewer and want to run it. Here we immediately notice that the output parameter does not appear in the GUI.
The tool can still be started, but aborts with an error message in the output parameter area.
It seems that the error is in the output parameter section. Do you have any clue, what we are doing wrong in the whole output parameter section (Notebook config, etc.)? The input parameters work.
Best
Sven
Solved! Go to Solution.
Hi @Sven_Harpering and @BenGiese,
Thank you for your patience! I was out of the office and could not respond sooner.
Currently in Map Viewer, it is not possible to use selected features as an input to an analysis tool. That said, if you configure a web tool in Experience Builder's Analysis widget, you will then be able to pass in selected features from the map popups and widgets like Select, Table, etc.
Here is an example of setting a selected feature as analysis input from a map popup:
I hope this helps. Please let me know if you have other questions.
Thank you,
Lingtao
Hi @Sven_Harpering,
Thanks for reaching out!
Looking forward to hearing back from you!
Lingtao
Product Engineer for ArcGIS Notebooks
Hi @xlt208 ,
I'm working with Sven on this project. Thanks for your guidance; it has already helped us a lot.
We are currently keeping {"url": ""} empty and have defined an input where the user can specify the output name. The .docx files are published as items in ArcGIS Online at the end. Our script creates a .docx file for each feature.
You asked for the error message. I don’t have access to it anymore because my script is working now. I think it was a problem with the specification of the output parameters and the URL we were pointing towards.
We want the user to select a feature on a map in the last step. The reports should then be created only for the selected features. This is possible in Experience Builder.
Apparently, the problem is that the selected features are not being passed along. Our input parameter is a feature set, but we still need to convert it to a feature set in the script. The selected features are being lost in the input. Do you have any idea what we need to set up to ensure the selection is considered?
This is our setting for the input features paramter:
This is the Code:
selected_damage = {
"url": "https://services3.arcgis.com/JhD3NyxTJcNiae8J/arcgis/rest/services/survey123_25027c5ec6294a65a7a851be8740f6f8_results/FeatureServer/0"
}
#get the url and return a feature layer
feature_layer_url = selected_damage["url"]
feature_layer = FeatureLayer(feature_layer_url)
# Get the Feature set
feature_set = feature_layer.query(where="1=1") # Abfrage mit allen Features
Until now this only returns a feature set with all features of the feature layer, not the selected.
Hi @xlt208,
do you have any further clue for us?
Thx
Sven
Hi @Sven_Harpering and @BenGiese,
Thank you for your patience! I was out of the office and could not respond sooner.
Currently in Map Viewer, it is not possible to use selected features as an input to an analysis tool. That said, if you configure a web tool in Experience Builder's Analysis widget, you will then be able to pass in selected features from the map popups and widgets like Select, Table, etc.
Here is an example of setting a selected feature as analysis input from a map popup:
I hope this helps. Please let me know if you have other questions.
Thank you,
Lingtao
@xlt208, thank you very much!