Hi there. I'm having an issue using a list in an SQL expression for FeatureClasstoFeatureClass export. Here is what I have so far. I'm working with a value list from user input.
cab_list = arcpy.GetParameterAsText(0)
olt_list = cab_list.replace(";", ",")
olt_list = olt_list.split(',')
str_list = '"{}"'.format('", "'.join(olt_list))
arcpy.FeatureClassToFeatureClass_conversion(outcabs, scratch, 'Cabs_Boundary', f"cab_id IN ({str_list})")
The expression evaluates to
cab_id IN ("ESC-C02", "ESC-C04", "SDY-HUT")
I'm getting this error:
ERROR 160144: An expected Field was not found or could not be retrieved properly.
I know that cab_id is the field name (not alias) so I'm guessing it has to be an issue with how I'm formatting the SQL clause. Any input is appreciated.