<?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 Re: Field calculate a table name into a field. in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculate-a-table-name-into-a-field/m-p/1272683#M67305</link>
    <description>&lt;P&gt;AFAIK, it's not possible to get the name of the table in the Calculate Field tool. But you can throw together a litte script where you get the year from the table name and then use that to calculate a new field:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.env.workspace = "G:/ArcGIS/.../my_database.gdb"
datasets = ["TestPoints_2019", "TestPoints_2020"]
for ds in datasets:
    year = ds.split("_")[-1]
    arcpy.management.CalculateField(ds, "Year", year, "PYTHON3")&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 28 Mar 2023 19:00:11 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-03-28T19:00:11Z</dc:date>
    <item>
      <title>Field calculate a table name into a field.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculate-a-table-name-into-a-field/m-p/1272653#M67303</link>
      <description>&lt;P&gt;I am trying to create a Year Field so I can combine multiple datasets into one then filter them by year.&amp;nbsp; The individual datasets only have the year in their name(example: table_2019).&amp;nbsp; Does anyone know how I can bring the name of the table in as a value in field calculator?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 18:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculate-a-table-name-into-a-field/m-p/1272653#M67303</guid>
      <dc:creator>Carlos_Par</dc:creator>
      <dc:date>2023-03-28T18:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate a table name into a field.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculate-a-table-name-into-a-field/m-p/1272683#M67305</link>
      <description>&lt;P&gt;AFAIK, it's not possible to get the name of the table in the Calculate Field tool. But you can throw together a litte script where you get the year from the table name and then use that to calculate a new field:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;arcpy.env.workspace = "G:/ArcGIS/.../my_database.gdb"
datasets = ["TestPoints_2019", "TestPoints_2020"]
for ds in datasets:
    year = ds.split("_")[-1]
    arcpy.management.CalculateField(ds, "Year", year, "PYTHON3")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Mar 2023 19:00:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculate-a-table-name-into-a-field/m-p/1272683#M67305</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-03-28T19:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Field calculate a table name into a field.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/field-calculate-a-table-name-into-a-field/m-p/1272684#M67306</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp; I will try that.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 19:01:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/field-calculate-a-table-name-into-a-field/m-p/1272684#M67306</guid>
      <dc:creator>Carlos_Par</dc:creator>
      <dc:date>2023-03-28T19:01:30Z</dc:date>
    </item>
  </channel>
</rss>

