<?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: Combining Fields for a file name in python in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1635018#M97428</link>
    <description>&lt;P&gt;Thanks I will give that a shot&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jul 2025 15:34:51 GMT</pubDate>
    <dc:creator>RobertBorchert</dc:creator>
    <dc:date>2025-07-22T15:34:51Z</dc:date>
    <item>
      <title>Combining Fields for a file name in python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1634722#M97415</link>
      <description>&lt;P&gt;I am exporting attachments from an Table with Attachments.&amp;nbsp; &amp;nbsp;I want to combine 2 fields from the base table&amp;nbsp; for the folder name.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have.&amp;nbsp; I have named the fields FileName1 and FileName2.&amp;nbsp; I just cannot figure out how to combine them&amp;nbsp;&lt;/P&gt;&lt;P&gt;Issues is the name of the origin Table&lt;/P&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;BR /&gt;"""&lt;BR /&gt;Generated by ArcGIS ModelBuilder on : 2025-07-21 13:23:03&lt;BR /&gt;"""&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;def Model(): # Model&lt;/P&gt;&lt;P&gt;# To allow overwriting outputs change overwriteOutput option to True.&lt;BR /&gt;arcpy.env.overwriteOutput = False&lt;/P&gt;&lt;P&gt;arcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx")&lt;BR /&gt;Issues = "Issues"&lt;BR /&gt;NRPExportTest = "\\\\gisfs01\\GIS_Cache$\\GISData\\RobertTemp\\NRPExportTest"&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;FileName1 = "ISSUENAME_W"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;FileName2 = "WORKGROUP"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;output_filename = f"{FileName1}"&lt;BR /&gt;# Process: Export Attachments (Export Attachments) (management)&lt;BR /&gt;Output_Directories = arcpy.management.ExportAttachments(in_dataset=Issues, out_location=NRPExportTest, subdirectory_field= &lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;output_filename&lt;/FONT&gt;)&lt;/STRONG&gt;[0]&lt;/P&gt;&lt;P&gt;if __name__ == '__main__':&lt;BR /&gt;# Global Environment settings&lt;BR /&gt;with arcpy.EnvManager(scratchWorkspace="\\\\gisfs01\\GIS_Cache$\\PortalServices\\PGIS\\FieldMarkups\\FieldMarkups.gdb", workspace="\\\\gisfs01\\GIS_Cache$\\PortalServices\\PGIS\\FieldMarkups\\FieldMarkups.gdb"):&lt;BR /&gt;Model()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 19:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1634722#M97415</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2025-07-21T19:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Fields for a file name in python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1634733#M97417</link>
      <description>&lt;P&gt;Or better yet for my purposes allow me to create a subfolder under&amp;nbsp;&lt;STRONG&gt;ISSUENAME_W&amp;nbsp;&lt;/STRONG&gt; using&amp;nbsp;&lt;STRONG&gt;WORKGROUP&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 19:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1634733#M97417</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2025-07-21T19:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Fields for a file name in python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1634771#M97418</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6992"&gt;@RobertBorchert&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're pretty close from what I can see! Do something like this here:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def Model():  # Model
    # To allow overwriting outputs change overwriteOutput option to True.
    arcpy.env.overwriteOutput = False

    arcpy.ImportToolbox(r"c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx")
    Issues = "Issues"
    NRPExportTest = r"\\gisfs01\GIS_Cache$\GISData\RobertTemp\NRPExportTest"
    FileName1 = "ISSUENAME_W"
    FileName2 = "WORKGROUP"
    # Create the folder here:
    output_filename = f"{FileName1} + '/' + {FileName2}"

    # Process: Export Attachments (Export Attachments) (management)
    Output_Directories = arcpy.management.ExportAttachments(
        in_dataset=Issues,
        out_location=NRPExportTest,
        subdirectory_field=output_filename
    )[0]

if __name__ == '__main__':
    # Global Environment settings
    with arcpy.EnvManager(
        scratchWorkspace=r"\\gisfs01\GIS_Cache$\PortalServices\PGIS\FieldMarkups\FieldMarkups.gdb",
        workspace=r"\\gisfs01\GIS_Cache$\PortalServices\PGIS\FieldMarkups\FieldMarkups.gdb"
    ):
        Model()&lt;/LI-CODE&gt;&lt;P&gt;You should be able to create a function string to add the two filenames together!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jul 2025 20:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1634771#M97418</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-07-21T20:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Combining Fields for a file name in python</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1635018#M97428</link>
      <description>&lt;P&gt;Thanks I will give that a shot&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jul 2025 15:34:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/combining-fields-for-a-file-name-in-python/m-p/1635018#M97428</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2025-07-22T15:34:51Z</dc:date>
    </item>
  </channel>
</rss>

