<?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: Layer name in new field after merge in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584360#M6405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey jbarrette,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for your reply. I was talking about 50 layers with one polygon in each. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I solved the problem myself, though. I used "parse path" in the model builder for "reading" the name of each layer and then added it as an attribute to the single polygon layers before merging them.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2013 06:28:30 GMT</pubDate>
    <dc:creator>GeorgHohberg1</dc:creator>
    <dc:date>2013-09-12T06:28:30Z</dc:date>
    <item>
      <title>Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584358#M6403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have 50 polygons named P1 to P50 which I want to merge. In another table I have area names associated to P1 - P50. When merging the polygons I cannot find any way to keep the layer names of the origional polygons in order to assign the area names to them. Is there a way to write the layer names of the original polygons in the resulting attribute table?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 07:36:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584358#M6403</guid>
      <dc:creator>GeorgHohberg1</dc:creator>
      <dc:date>2013-09-10T07:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584359#M6404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not clear on the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have 50 polygons named P1 to P50 which I want to merge.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I cannot find any way to keep the layer names of the origional polygons &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this mean that you have 50 polygon feature classes (aka layers) or is this a single feature class with 50 polygons?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 14:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584359#M6404</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2013-09-11T14:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584360#M6405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey jbarrette,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for your reply. I was talking about 50 layers with one polygon in each. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I solved the problem myself, though. I used "parse path" in the model builder for "reading" the name of each layer and then added it as an attribute to the single polygon layers before merging them.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 06:28:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584360#M6405</guid>
      <dc:creator>GeorgHohberg1</dc:creator>
      <dc:date>2013-09-12T06:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584361#M6406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if you'll remember this after 6 years, can you explain what you've done to achieve this? I'm currently trying to do this very thing &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2019 02:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584361#M6406</guid>
      <dc:creator>JasonLi1</dc:creator>
      <dc:date>2019-07-18T02:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584362#M6407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;I dont't remember what I did, but I could send you the toolbox I used back then and you can figure it out yourself. In order to be able to send you a message you have to follow me, I think. Responding directly to your email did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Georg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2019 08:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584362#M6407</guid>
      <dc:creator>GeorgHohberg1</dc:creator>
      <dc:date>2019-07-18T08:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584363#M6408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that'd be helpful, i just followed you back&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2019 15:45:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584363#M6408</guid>
      <dc:creator>JasonLi1</dc:creator>
      <dc:date>2019-07-18T15:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584364#M6409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys -&lt;/P&gt;&lt;P&gt;I'm also trying to do the exact same thing.&amp;nbsp; Can I get in on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Johnny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:25:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584364#M6409</guid>
      <dc:creator>JohnBranum</dc:creator>
      <dc:date>2019-07-25T15:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584365#M6410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason, I'm also trying to do this same thing. Did you sort it out, and if so, would you mind sharing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2019 12:27:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/584365#M6410</guid>
      <dc:creator>KevinWyjad</dc:creator>
      <dc:date>2019-08-30T12:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/1103962#M8409</link>
      <description>&lt;P&gt;For anyone coming across this question (8 years later), this functionality is now available in the ArcGIS Pro Merge (Data Management) tool: &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/merge.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/merge.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The tool has an "&lt;U&gt;Add source information to output&lt;/U&gt;" checkbox - if you check it, it'll add a field named&amp;nbsp;&lt;SPAN class=""&gt;MERGE_SRC&lt;/SPAN&gt; to the output:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The values in the &lt;SPAN class=""&gt;MERGE_SRC&lt;/SPAN&gt; field will indicate the input dataset path or layer name that is the source of each record in the output.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;When I used it, I added layers to the tool from my Map, and the values in the resulting MERGE_SRC field looked like "GroupName\LayerName" (as named in the Map's Contents list). I haven't tried it with data added to the tool directly from browsing - maybe it puts the full pathname if you do it that way.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 15:04:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/1103962#M8409</guid>
      <dc:creator>David_Kimball</dc:creator>
      <dc:date>2021-10-01T15:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/1237988#M8485</link>
      <description>&lt;P&gt;To enhance the answer from David above. This option gives you only the layer name if you use drop down menu in Merge tool. If you browse to the file using Browse button it gives you the data path. However, it is very easy to include absolute path to the layers you are merging with only couple of lines in Python window (or if you create the actual Python script) without a need to use tedious Browse button in Merge tool.&lt;/P&gt;&lt;P&gt;Usual workflow is that your project contains at least one Map frame (data frame) and more often than that many layers beside the ones you want to merge. So best way is to create Group Layer where you put only layers that you want to merge. Having this then just open Python window (View &amp;gt; Python window) and paste the code from below with slight modification to the Python window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;proj = arcpy.mp.ArcGISProject('CURRENT')
# You might have many data frames in your project and you don't know which position in your list has. Change line item.name == "Map": to the name that you have. Default is Map but you might have anything
for index, item in enumerate(proj.listMaps()):
    if item.name == "Map":
        # You want to process only relevant Data Frame (aka Map)
        mf = proj.listMaps()[index]
        mfl = mf.listLayers()
lyr_names = []
for ly in mfl:
    # Change to your Group Layer name. So Merging to whatever you have
    if ly.isGroupLayer and ly.name == "Merging":
        lyrs = ly.listLayers()
        for lyr in lyrs:
            desc = arcpy.Describe(lyr)
            # arcpy.Describe catalogPath gives you the full path to data. So also the extension .shp for ESRI Shapefile if you have any
            lyr_names.append(desc.catalogPath)
# Because you are passing the full path to this tool it will write the absolute path and not the layer name.
# Change the output path (in this case D:\testing\testing2022\test.gdb\bbb) to whatever fits you
arcpy.management.Merge(lyr_names, r"D:\testing\testing2022\test.gdb\bbb", "" , "ADD_SOURCE_INFO")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 20:42:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/1237988#M8485</guid>
      <dc:creator>DamB99</dc:creator>
      <dc:date>2022-12-05T20:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Layer name in new field after merge</title>
      <link>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/1486376#M8575</link>
      <description>&lt;P&gt;It's 2024, and still useful, any chance you are still in the business and you can forward the toolbox to me too?&lt;BR /&gt;&lt;BR /&gt;TYIA&lt;BR /&gt;&lt;BR /&gt;Max&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 16:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/layer-name-in-new-field-after-merge/m-p/1486376#M8575</guid>
      <dc:creator>MaxPetri</dc:creator>
      <dc:date>2024-06-06T16:18:32Z</dc:date>
    </item>
  </channel>
</rss>

