I am trying to update a feature class by joining it to a table after deleting columns in the target layer with the same names as columns in the join table. I thought the only way to do this in arcpy was to make the featureclass a feature layer and make the table a table view. I tried my script with out using featur layer or table view and got an error that the datatype was not a raster or mosiac. I then made the feaute layer and table view but now am getting:
ERROR 000732 Dataset does not exist or is not supported.
Here is my script so far:
# script to update Signal dashboard
import arcpy
from arcpy import env
# set up env DB to overwrite outputs
env.workspace = r"C:\Users\Master\Documents\ArcGIS\Projects\Signal_Mgmt\Signal_Related_Apps.gdb"
env.overwriteOutput = True
# set up paths vars, etc
outPath = r"C:\Users\Master\Documents\ArcGIS\Projects\Signal_Mgmt\Signal_Related_Apps.gdb"
# the table used for updating featureclass
table = r"C:\Users\Master\OneDrive\Desktop\Temp out\EOC\Signal_MGMT_Census\AC_zips_rates.csv"
joinTable = arcpy.TableToTable_conversion(table, outPath, "AC_zips_rates")
# Current featureclass published to AGOL
inFC = r"C:\Users\Master\Documents\ArcGIS\Projects\Signal_Mgmt\Signal_Related_Apps.gdb\Zips"
# Get rid of fields from previous update
delFields = ["Count", "Jul_2020_Pop", "Rate_per_1000", "Popup", "Legend", "Bin"]
arcpy.management.DeleteField(inFC, delFields)
# make layer and table views to perform join ops
inField = arcpy.MakeFeatureLayer_management(inFC, "target_lyr")
joinView = arcpy.MakeTableView_management(joinTable, "join_view")
inTab = arcpy.JoinField_management(inField, "Zip_Number", joinView, "Zip")
# export joined tables as new FC
joinOut = arcpy.FeatureClassToFeatureClass_conversion(inTab, outPath, "Signal_Update")
# Remove join from current featureclass so join does not interfre with overwrite
arcpy.RemoveJoin_management(inField)
# Overwrite current featureclass with new featueclass
upFC = arcpy.FeatureClassToFeatureClass_conversion(joinOut, outPath, "Zips")
# delete join field from new featureclass
arcpy.management.DeleteField(upFC, "Zip")
# apply symbology layer to new featireclass
arcpy.ApplySymbologyFromLayer_management(upFC, r"C:\Users\Master\OneDrive\Desktop\Temp out\EOC\Signal_MGMT_Census\Signal_Zips.lyrx")
Am I going about this the wrong way? I can't seem to do a join op either way. I'm using ArcGIS Pro 2.5.