Combine information from spatial join

I performed a spatial join based on point features that fell within polygons of interest. I now want to combine these features by polygon (field ID) and create a new field that combines information from one field. In the image below, I want to combine by TARGET_FID (ex: TARGET_FID = 7) and preserve the information from WS_Type to get a new field that would have, "Storage, Storage, Spring, Spring". I tried dissolve but the tool won't run because the "file is not supported".

• I don't know of any tool that will dissolve with concatenation of strings, you might need to write some python for this. Is your intended output a table or feature class? – Michael Stimson Apr 25 '18 at 23:24
• I thought that might be the case... Intended output is a feature class, but I could make do with a table. – nso921 Apr 25 '18 at 23:34
• Do you have any python ability? – Michael Stimson Apr 25 '18 at 23:43
• A little bit, but I'm pretty new. – nso921 Apr 25 '18 at 23:47
• From your snapshot, I can see that you picked ONE_TO_MANY Join Operation option. In fact by using ONE_TO_ONE option with field mapping will give you what you are after. Have a look at gis.stackexchange.com/questions/178757/…. – fatih_dur Apr 26 '18 at 7:24

This should get you fairly close:

import os, sys, arcpy

# change as needed
InFC  = r'c:\your\path\to\JoinedFeatures.shp'
OutFC = r'c:\your\path\to\OutputTable.dbf'

ValDict = {} # new, empty dictionary

# Loop through all rows and populate the dictionary
with arcpy.da.SearchCursor(InFC,['TARGET_FID','WS_Type']) as SCur:
for ThisRow in SCur:
if ThisRow[0] in ValDict:
ValDict[ThisRow[0]].append(ThisRow[1]) # add this value to the end of the list
else:
ValDict[ThisRow[0]] = []               # make a new, empty, list for this TARGET_FID
ValDict[ThisRow[0]].append(ThisRow[1]) # add this value to the end of the list

# create a new table.. os.path.dirname is the folder, os.path.basename is the file name
arcpy.CreateTable_management(os.path.dirname(OutFC),os.path.basename(OutFC))

After compiling into a dictionary loop through the dictionary making each list into a string using ','.join() and insert the row into a new DBF file using an insert cursor.