<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Preventing text from becoming Date type field using arcpy.conversion.TableToTable in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/preventing-text-from-becoming-date-type-field/m-p/1075545#M42903</link>
    <description>&lt;P&gt;Hi, I'm trying to prevent ArcGIS Pro from converting text (dates) to a Date type field when running arcpy.conversion.TableToTable(). The 'from' table is a csv file.&lt;/P&gt;&lt;P&gt;I've tried creating a FieldMappings from the csv table, and changing the relevant FieldMap outputField type, however when I apply this using replaceFieldMap the output table ends up blank (although it does apply the field as text instead of date).&lt;/P&gt;&lt;P&gt;My code is something like:&lt;/P&gt;&lt;P&gt;fms = arcpy.FieldMappings()&lt;BR /&gt;fms.addTable(csv_file)&lt;/P&gt;&lt;P&gt;fm = fms.getFieldMap(fms.findFieldMapIndex("date_field"))&lt;BR /&gt;fname = fm.outputField&lt;BR /&gt;fname.type = "String"&lt;BR /&gt;fm.outputField = fname&lt;BR /&gt;fms.replaceFieldMap(fms.findFieldMapIndex("date_field"), fm)&lt;/P&gt;&lt;P&gt;arcpy.conversion.TableToTable(csv_file, aprxgdb, 'out_table', '', fms)&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jul 2021 03:19:37 GMT</pubDate>
    <dc:creator>ToyotaT18</dc:creator>
    <dc:date>2021-07-05T03:19:37Z</dc:date>
    <item>
      <title>Preventing text from becoming Date type field using arcpy.conversion.TableToTable</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/preventing-text-from-becoming-date-type-field/m-p/1075545#M42903</link>
      <description>&lt;P&gt;Hi, I'm trying to prevent ArcGIS Pro from converting text (dates) to a Date type field when running arcpy.conversion.TableToTable(). The 'from' table is a csv file.&lt;/P&gt;&lt;P&gt;I've tried creating a FieldMappings from the csv table, and changing the relevant FieldMap outputField type, however when I apply this using replaceFieldMap the output table ends up blank (although it does apply the field as text instead of date).&lt;/P&gt;&lt;P&gt;My code is something like:&lt;/P&gt;&lt;P&gt;fms = arcpy.FieldMappings()&lt;BR /&gt;fms.addTable(csv_file)&lt;/P&gt;&lt;P&gt;fm = fms.getFieldMap(fms.findFieldMapIndex("date_field"))&lt;BR /&gt;fname = fm.outputField&lt;BR /&gt;fname.type = "String"&lt;BR /&gt;fm.outputField = fname&lt;BR /&gt;fms.replaceFieldMap(fms.findFieldMapIndex("date_field"), fm)&lt;/P&gt;&lt;P&gt;arcpy.conversion.TableToTable(csv_file, aprxgdb, 'out_table', '', fms)&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 03:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/preventing-text-from-becoming-date-type-field/m-p/1075545#M42903</guid>
      <dc:creator>ToyotaT18</dc:creator>
      <dc:date>2021-07-05T03:19:37Z</dc:date>
    </item>
  </channel>
</rss>

