Hello everyone,
I'm creating a custom arcpy script geoprocessing tool that allows a user to do the following:
1. Geocode an address table or process an XY table.
2. Do N spatial joins based on how many feature classes the user selects.
I was successful in creating the script to handle #1. But for #2, while I can ask the user to input N feature classes, I also want to allow them to select which fields they want to keep from each layer after each spatial join, and this is where I'm stuck. I would like to implement a script that would either display the available fields for all of the feature classes in the same pane or separate window (before they click "Run") for user to add as text in a separate parameter, or display as options that the user can select in the UI. My current script seems to only capture the fields for the first feature class. I don't know if it's a limitation or perhaps I'm missing something. I'm new to arcpy, so any help/pointers would be appreciated, thank you in advance!
Code snippet:
poly_fc = arcpy.GetParameterAsText(0)
field_names = [f.name for f in arcpy.ListFields(poly_fc)]
arcpy.SetParameterAsText(1, ";".join(field_names))
--------------------------------------------------------------------------
Fields for the first selected layer are displayed:

My current implementation of the tool properties:
