In my code below, how do I get the Desired Output?
# Get a list of all 'SITE_NFID' in the dashboard_site_summary table that don't have a match in the nfid_fqn_associations table
dashboard_site_summary_list = []
with arcpy.da.SearchCursor(dashboard_site_summary, ['SITE_NFID']) as cursor:
for row in cursor:
if row[0] not in nfa_dict:
dashboard_site_summary_list.append(row[0]))
# Insert the NFID's into the SHP_Report that didn't have a NFA match to ensure ALL dashboard_site_summary NFID's are accounted
cursor = arcpy.da.InsertCursor(shp_report, ['SITE_NFID'])
for item in dashboard_site_summary_list:
cursor.insertRow(item)
Current output in the "dashboard_site_summary_list":
Current Output = ['1903BRUF.65', '1903BRUF.65']
<---Doesn't work
Desired Output = [(('1903BRUF.65'),),(('1903BRUF.65'),)]
<----------Works
Article I found showing correct syntax: https://support.esri.com/en/technical-article/000011654
My best attempt to fix the output of the list:
# Get a list of all 'SITE_NFID' in the dashboard_site_summary table that don't have a match in the nfid_fqn_associations table
dashboard_site_summary_list = []
with arcpy.da.SearchCursor(dashboard_site_summary, ['SITE_NFID']) as cursor:
for row in cursor:
if row[0] not in nfa_dict:
dashboard_site_summary_list.append('((' + str(row[0]) + ',),')
cursor.insertRow(item)
and keep your "current output". Trycursor.insertRow([item])
orcursor.insertRow((item,))