Hi all,
I'm trying to find a way that I can import a list of values that I have in an excel file into a "List of Values" string variable in my model? I'm trying to avoid having to type each one in manually.
Use "Excel to Table" to load the data into a table, then "Calculate Value" with some Python cursors to join the column values into one big string. Something like this for the code block:
def get_list(table):
return ";".join(str(x[0]) for x in arcpy.da.SearchCursor(table, "My_Field_Name"))
and then you can call the function like get_list("%output_table%"), replacing the variable with whatever the name of your output table is in modelbuilder.