I have a python toolbox I built with a tool which takes multiple excel files as an input parameter. The problem is I cannot figure out how to get the files or file names in order to import them in the execute block.
relevant code:
def getParameterInfo(self):
param0 = arcpy.Parameter(
displayName = "Service Tap Placement output excels",
name = "Excels",
datatype = "DEFile",
parameterType = "Required",
direction = "Input",
multiValue = True)
param0.filter.list = ['xls', 'xlsx']
and
def execute(self, parameters, messages):
# from parameters
excelList = parameters[0].values
move = parameters[1].value
myPath = parameters[2].valueAsText
things I've tried :
1) defining excelList as shown in the second code block, returns: [geoprocessing value object object at 0x28BFC848, geoprocessing value object object at 0x28BFC770, geoprocessing value object object at 0x28BFC3C8]
2) excelList = parameters[0].valueAsText, returns: C:\Workspace\TapResnap\testE_script\Results_ServiceTapPlacement\Results_nfp01.xls;C:\Workspace\TapResnap\testE_script\Results_ServiceTapPlacement\Results_nfp02.xls;C:\Workspace\TapResnap\testE_script\Results_ServiceTapPlacement\Results_nfp03.xls
Problem is I can't figure out how to access the objects (from try 1) as needed, I got close using Multivalue parameter as text in Python toolbox - reading in to imported module function but I'd like to avoid having to separate them out from one string (try 2) if possible (there must be an easier way), and obviously I'm not working with rasters (is there something similar for my case?). I also see some promise here, but I'm not fully understanding how to apply it to my situation.
3) adding "return excelList" to the execute block (just to be able to play with it in the python window, I'm actually trying to import them to arc tables) after using the same assignment as try 1, importing the toolbox, then setting a variable to the tool result in the python window: fileList = arcpy.[Tool]_Toolbox... but then I have the same problem as try 1, I'm unsure how to access the individual file values (in any way).
This is my first python toolbox experience, and I have (obviously) limited experience dealing with result objects and output parameters.