Hello,
I am new to using custom web tools in Experience Builder. I created a custom script in ArcGIS Pro, published it as a web tool to my organization's enterprise portal, and linked the tool to the analysis widget in Experience Builder. The tool simply aims to accept a user-input CSV and append the data to a hosted feature layer in AGOL. The tool works fine in ArcGIS Pro and the first time it runs in Experience Builder it works!
However, after it is run once, the option for users to upload a local CSV disappears, and the tool becomes unusable. I'm not sure if it is something to do with my tool's parameters, execution, or validation or if it is something with Experience Builder.
Any guidance to get my tool running more than once would be much appreciated 🙏
Also, for some reason I can't upload photos or screenshots in my post so I can't include a visual of what is happening on experience builder, but here is some info from my tool for context.
Parameters:
Parameter (0)
(Label: Input_CSV) , (Data Type: File) , (Type: Required) , (Direction: Input)
Parameter (1)
(Label: PSR_Item) , (Data Type: String) , (Type: Required) , (Direction: Input) , ... , (Default: 2524768276fe4cb08f9a14586cf37f4c)
Parameter (2)
(Label: Status) , (Data Type: String) , (Type: Optional) , (Direction: Output)
Execution:
import arcpy
from arcgis.gis import GIS
from arcgis.features import FeatureLayer
import pandas as pd
gis = GIS("", username='', password='')
user_input_csv = arcpy.GetParameterAsText(0)
psr_input = arcpy.GetParameterAsText(1)
psr_item = gis.content.get(psr_input)
psr_hfl = psr_item.layers[0]
csv_df = pd.read_csv(user_input_csv)
csv_df['Resolution'] = 'Pending'
sdf = pd.DataFrame.spatial.from_xy(csv_df, x_column='Geolocation (Longitude)', y_column='Geolocation (Latitude)', sr=4326)
sdf.rename(columns={'Case Number': 'USER_SortCase_Number', 'Status': 'USER_SortStatus', 'Street Address': 'USER_SortStreet_Address', 'Problem Type': 'Problem_Type'}, inplace=True)
psr_hfl.edit_features(adds=sdf)
arcpy.SetParameterAsText(2, "Tool completed successfully.")
The validation is the default code from the script but here it is.
Validation:
class ToolValidator:
# Class to add custom behavior and properties to the tool and tool parameters.
def __init__(self):
# Set self.params for use in other validation methods.
self.params = arcpy.GetParameterInfo()
def initializeParameters(self):
# Customize parameter properties. This method gets called when the
# tool is opened.
return
def updateParameters(self):
# Modify the values and properties of parameters before internal
# validation is performed.
return
def updateMessages(self):
# Modify the messages created by internal validation for each tool
# parameter. This method is called after internal validation.
return
If I get the ability to include screenshots of the issue in experience builder I will add them later on in this thread.
Hello, I too am having this issue where the icon to upload files just disappears.
Hi @ThomasCoughlin, is this a bug in web experience?