<?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 add the name of FeatureClasses to the names of the joined fields with Arcpy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127495#M63287</link>
    <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/how-can-i-include-featureclass-names-with-join/m-p/1127489#M49184" target="_blank"&gt;Re: How can I include featureClass names with join... - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;provides an alternate solution using numpy/arcpy functionality&lt;/P&gt;</description>
    <pubDate>Sun, 19 Dec 2021 23:40:46 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-12-19T23:40:46Z</dc:date>
    <item>
      <title>how to add the name of FeatureClasses to the names of the joined fields with Arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127426#M63266</link>
      <description>&lt;P&gt;Using ArcPy, how do I add the name of FeatureClasses to the names of the joined fields?&lt;/P&gt;&lt;P&gt;This is my code which I think helps explain what I am looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your help&lt;/P&gt;&lt;PRE&gt;--------------------------------------------------------------------
&lt;SPAN class=""&gt;import&lt;/SPAN&gt; arcpy
arcpy.env.workspace = arcpy.GetParameterAsText(&lt;SPAN class=""&gt;0&lt;/SPAN&gt;)
fc = arcpy.GetParameterAsText(&lt;SPAN class=""&gt;1&lt;/SPAN&gt;)
featureList = arcpy.ListFeatureClasses()
field_names = [f.name &lt;SPAN class=""&gt;for&lt;/SPAN&gt; f &lt;SPAN class=""&gt;in&lt;/SPAN&gt; arcpy.ListFields(fc)]
&lt;SPAN class=""&gt;for&lt;/SPAN&gt; feature &lt;SPAN class=""&gt;in&lt;/SPAN&gt; featureList:
    fields = [&lt;SPAN class=""&gt;"AAAA"&lt;/SPAN&gt;]
    arcpy.JoinField_management(&lt;SPAN class=""&gt;"BATI"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"ID_BATI"&lt;/SPAN&gt;, feature, &lt;SPAN class=""&gt;"ID_BATI"&lt;/SPAN&gt;, fields)
------------------------------------------------------------------&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="khalidechlouchi_0-1639897009181.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/29994i72C52C8A9E75BD5E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="khalidechlouchi_0-1639897009181.png" alt="khalidechlouchi_0-1639897009181.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Dec 2021 06:59:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127426#M63266</guid>
      <dc:creator>khalidechlouchi</dc:creator>
      <dc:date>2021-12-19T06:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to add the name of FeatureClasses to the names of the joined fields with Arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127435#M63267</link>
      <description>&lt;P&gt;check out &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-join.htm" target="_blank"&gt;Add Join (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Dec 2021 10:25:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127435#M63267</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-19T10:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to add the name of FeatureClasses to the names of the joined fields with Arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127476#M63286</link>
      <description>&lt;P&gt;Thank you&lt;SPAN&gt;&amp;nbsp;for your&amp;nbsp;&lt;/SPAN&gt;feedback&lt;SPAN&gt;!&lt;/SPAN&gt;, &lt;SPAN&gt;I've checked the documentation.&amp;nbsp;I chose JoinField because I can specify the fields to join but AddJoin it join all the fields and that for a dozen featureClass it will give me a hundred fields in the table to delete after and leave only the desired fields.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I modified my code by inserting (arcpy.env.qualifiedFieldNames = True) and arcpy.MakeFeatureLayer_management in my code.&amp;nbsp;&lt;SPAN&gt;but the output field name still does not include the featureClasses names.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;arcpy&lt;BR /&gt;&lt;SPAN&gt;# Set environment settings&lt;BR /&gt;&lt;/SPAN&gt;arcpy.env.workspace = arcpy.GetParameterAsText(&lt;SPAN&gt;0&lt;/SPAN&gt;)&lt;BR /&gt;arcpy.env.qualifiedFieldNames = &lt;SPAN&gt;True&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# Set local variables&lt;BR /&gt;&lt;/SPAN&gt;FcCible = &lt;SPAN&gt;"BATI"&lt;BR /&gt;&lt;/SPAN&gt;featurelayer = &lt;SPAN&gt;"Batijoin"&lt;BR /&gt;&lt;/SPAN&gt;IDjoin = &lt;SPAN&gt;"ID_BATI"&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;# Create a feature layer from the BATI featureclass&lt;BR /&gt;&lt;/SPAN&gt;arcpy.MakeFeatureLayer_management(FcCible&lt;SPAN&gt;, &lt;/SPAN&gt;featurelayer)&lt;BR /&gt;featureList = arcpy.ListFeatureClasses()&lt;BR /&gt;&lt;SPAN&gt;for &lt;/SPAN&gt;feature &lt;SPAN&gt;in &lt;/SPAN&gt;featureList:&lt;BR /&gt;    fields = [&lt;SPAN&gt;"AAAA"&lt;/SPAN&gt;]&lt;BR /&gt;    arcpy.JoinField_management(featurelayer&lt;SPAN&gt;, &lt;/SPAN&gt;IDjoin&lt;SPAN&gt;, &lt;/SPAN&gt;feature&lt;SPAN&gt;, &lt;/SPAN&gt;IDjoin&lt;SPAN&gt;, &lt;/SPAN&gt;fields)&lt;BR /&gt;&lt;SPAN&gt;# Copy the layer to a new permanent feature class&lt;BR /&gt;&lt;/SPAN&gt;outFeature = &lt;SPAN&gt;"atest.gdb/Batijoin"&lt;BR /&gt;&lt;/SPAN&gt;arcpy.CopyFeatures_management(featurelayer&lt;SPAN&gt;, &lt;/SPAN&gt;outFeature)&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Dec 2021 20:08:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127476#M63286</guid>
      <dc:creator>khalidechlouchi</dc:creator>
      <dc:date>2021-12-19T20:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to add the name of FeatureClasses to the names of the joined fields with Arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127495#M63287</link>
      <description>&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/how-can-i-include-featureclass-names-with-join/m-p/1127489#M49184" target="_blank"&gt;Re: How can I include featureClass names with join... - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;provides an alternate solution using numpy/arcpy functionality&lt;/P&gt;</description>
      <pubDate>Sun, 19 Dec 2021 23:40:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127495#M63287</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-19T23:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to add the name of FeatureClasses to the names of the joined fields with Arcpy?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127792#M63297</link>
      <description>&lt;P&gt;Thank you Dan, I will try.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 21:25:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-the-name-of-featureclasses-to-the-names/m-p/1127792#M63297</guid>
      <dc:creator>khalidechlouchi</dc:creator>
      <dc:date>2021-12-20T21:25:10Z</dc:date>
    </item>
  </channel>
</rss>

