<?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: How to match field mappinps with different name in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1010004#M5325</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7474"&gt;@JoseSanchez&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The link below provides an example that shows how to map fields with different names:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/append-tool-and-field-mapping-help-examples/td-p/427282" target="_blank"&gt;https://community.esri.com/t5/python-questions/append-tool-and-field-mapping-help-examples/td-p/427282&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Dec 2020 00:41:50 GMT</pubDate>
    <dc:creator>MehdiPira1</dc:creator>
    <dc:date>2020-12-16T00:41:50Z</dc:date>
    <item>
      <title>How to match field mappinps with different name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1009892#M5323</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I match&amp;nbsp; fields that have a different names, for example the same field is called ProjNum in one FC and ProjectNumber in another.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;currently I am using this source code to append one FC or Table to another.&lt;/P&gt;&lt;P&gt;fieldmappings = arcpy.FieldMappings()&lt;/P&gt;&lt;P&gt;#Like when you manually choose a layer in the toolbox and it adds the fields to grid&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if arcpy.Exists (CurrentFeatureOutput):&lt;BR /&gt;fieldmappings.addTable( CurrentFeatureOutput)&lt;BR /&gt;fieldmappings.addTable(CurrentFeatureInput )&lt;BR /&gt;arcpy.Append_management( CurrentFeatureInput , CurrentFeatureOutput , "NO_TEST", fieldmappings)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 20:13:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1009892#M5323</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2020-12-15T20:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to match field mappinps with different name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1010004#M5325</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7474"&gt;@JoseSanchez&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The link below provides an example that shows how to map fields with different names:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/append-tool-and-field-mapping-help-examples/td-p/427282" target="_blank"&gt;https://community.esri.com/t5/python-questions/append-tool-and-field-mapping-help-examples/td-p/427282&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 00:41:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1010004#M5325</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2020-12-16T00:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to match field mappinps with different name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1010113#M5328</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&amp;nbsp;&amp;nbsp;MehdiPira1&lt;/P&gt;&lt;P&gt;I am going to reuse the function posted as sample, it is exactly what I need&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/43250"&gt;@MehdiPira1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7474"&gt;@JoseSanchez&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The link below provides an example that shows how to map fields with different names:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/python-questions/append-tool-and-field-mapping-help-examples/td-p/427282" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/python-questions/append-tool-and-field-mapping-help-examples/td-p/427282&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def fieldMapping(fc_in,fc_out):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # value in the 'in' feature class, value in the feature class to be appended to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dico = {'Assessed_Value': 'ARN', 'Total_Value': 'TotalValue'}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldmappings = arcpy.FieldMappings()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldmappings.addTable(fc_in)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldmappings.addTable(fc_out)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for input,output in dico.items():&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field_to_map_index = fieldmappings.findFieldMapIndex(output)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field_to_map = fieldmappings.getFieldMap(field_to_map_index)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field_to_map.addInputField(fc_in,input)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldmappings.replaceFieldMap(field_to_map_index, field_to_map)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fieldmappings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logging.exception('Generic error raised during fieldmap creation')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 12:53:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1010113#M5328</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2020-12-16T12:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to match field mappinps with different name</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1010828#M5335</link>
      <description>&lt;P&gt;&lt;EM&gt;Glad to hear that,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7474"&gt;@JoseSanchez&lt;/a&gt;&amp;nbsp;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please mark as helpful if you find it helpful. If it answered your question please mark it as answered.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Thanks&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 00:36:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-match-field-mappinps-with-different-name/m-p/1010828#M5335</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2020-12-18T00:36:22Z</dc:date>
    </item>
  </channel>
</rss>

