<?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: Append Events Python Field Mapping Parameters in Roads and Highways User Group (RHUG) Questions</title>
    <link>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167583#M631</link>
    <description>&lt;P&gt;Yes, it's the opaqueness of the specific field maps that's the issue. I was just hoping someone knew before I spent time on adjusting database/tool parameters to narrow it down (as well as maybe have this as a reference on the web for anyone else with the same issue).&lt;/P&gt;&lt;P&gt;Maybe I'm missing something obvious, but I really can't think of what the -1's are. The true/true/false ones are easier to figure out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did in the script was list fields then create a formatted string list with the field properties, but right now it has those unknown values hardcoded in.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2022 16:29:43 GMT</pubDate>
    <dc:creator>Colin_Schut</dc:creator>
    <dc:date>2022-04-25T16:29:43Z</dc:date>
    <item>
      <title>Append Events Python Field Mapping Parameters</title>
      <link>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167121#M628</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;field_mapping = 'YEAR_ "YEAR_" true true false 2 Short 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,YEAR_,-1,-1;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to use append events in python to append non-spatial data to a LRS event. The append events documentation lists out the parameters of the tools, but not what the parameters in the field mapping portion are since it's just one giant string. I have got it working but right now it's reliant on all the fields having the same properties for my unknown ones.&lt;/P&gt;&lt;P&gt;Does anyone know them all? The above is the example from the documentation.&lt;/P&gt;&lt;P&gt;Year_ = Target Field Name&lt;/P&gt;&lt;P&gt;"Year_" = Target Field Alias&lt;/P&gt;&lt;P&gt;true = null allowed?&lt;/P&gt;&lt;P&gt;true = null allowed?&lt;/P&gt;&lt;P&gt;false = required?&lt;/P&gt;&lt;P&gt;2 = Length&lt;/P&gt;&lt;P&gt;Short = Type&lt;/P&gt;&lt;P&gt;0&amp;nbsp; = Scale&amp;nbsp;&lt;/P&gt;&lt;P&gt;0 = Precision&lt;/P&gt;&lt;P&gt;First = Merge Rule&lt;/P&gt;&lt;P&gt;# = Delimiter? (how does this apply to the tool? )&lt;/P&gt;&lt;P&gt;NY_Data = Input dataset&lt;/P&gt;&lt;P&gt;Year_ = Input Field Name&lt;/P&gt;&lt;P&gt;-1 = start_position&lt;/P&gt;&lt;P&gt;-1 = end_position&lt;/P&gt;&lt;P&gt;(Also if anyone wants to critique my novice python code let me know!)&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:37:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167121#M628</guid>
      <dc:creator>Colin_Schut</dc:creator>
      <dc:date>2022-04-25T23:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Append Events Python Field Mapping Parameters</title>
      <link>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167374#M629</link>
      <description>&lt;P&gt;What this part of the code refers to is the field mappings object, (&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldmappings.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldmappings.htm&lt;/A&gt;) which is a collection of field maps (&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldmap.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldmap.htm&lt;/A&gt;) that create a field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The easiest method to script this would be to create a series of field maps, then add them to a field mappings object, then refer to the field mappings object in the script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This if fairly opaque, but if you conduct a regular append in ArcMap (I am assuming you are still in desktop since this is RHUG) you can follow along with the code in the field map window.&lt;/P&gt;&lt;P&gt;My best recommendation for any programmer - test on a copy of your data!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 01:51:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167374#M629</guid>
      <dc:creator>BJCovington</dc:creator>
      <dc:date>2022-04-25T01:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Append Events Python Field Mapping Parameters</title>
      <link>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167492#M630</link>
      <description>&lt;P&gt;I personally don't know the properties and am a very novice coder so I get around this by running the Append Events Tool then copying the code snippet and making any adjustment necessary for the real append that I need to do. I take the tables people send me and append them into GDB temp tables tables but that allows me to get the data in the schema that I need it in and puts the data in a location where my code doesn't have to change. Then I the append events tool grabs the good data from the temp tables.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my process if this at all helps:&lt;/P&gt;&lt;P&gt;1. Create blank source table (table that will be appended).&lt;/P&gt;&lt;P&gt;2. Run append events (adjust the field mapping parameters in the tool manually)&lt;/P&gt;&lt;P&gt;3. Look at your results, copy as code snippet.&lt;/P&gt;&lt;P&gt;4. There you have the field mapping all done and proper the way the system wants it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 14:14:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167492#M630</guid>
      <dc:creator>CameronCole</dc:creator>
      <dc:date>2022-04-25T14:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Append Events Python Field Mapping Parameters</title>
      <link>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167583#M631</link>
      <description>&lt;P&gt;Yes, it's the opaqueness of the specific field maps that's the issue. I was just hoping someone knew before I spent time on adjusting database/tool parameters to narrow it down (as well as maybe have this as a reference on the web for anyone else with the same issue).&lt;/P&gt;&lt;P&gt;Maybe I'm missing something obvious, but I really can't think of what the -1's are. The true/true/false ones are easier to figure out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did in the script was list fields then create a formatted string list with the field properties, but right now it has those unknown values hardcoded in.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 16:29:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167583#M631</guid>
      <dc:creator>Colin_Schut</dc:creator>
      <dc:date>2022-04-25T16:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Append Events Python Field Mapping Parameters</title>
      <link>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167766#M632</link>
      <description>&lt;P&gt;The -1's come from the field map parameter that allows for a slice of data from your string field. It is the default positional argument for the start/end of the string.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BJCovington_0-1650929344986.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/39825i6CDC463944D200C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BJCovington_0-1650929344986.png" alt="BJCovington_0-1650929344986.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:29:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167766#M632</guid>
      <dc:creator>BJCovington</dc:creator>
      <dc:date>2022-04-25T23:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Append Events Python Field Mapping Parameters</title>
      <link>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167773#M633</link>
      <description>&lt;P&gt;Brilliant, thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:38:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/roads-and-highways-user-group-rhug-questions/append-events-python-field-mapping-parameters/m-p/1167773#M633</guid>
      <dc:creator>Colin_Schut</dc:creator>
      <dc:date>2022-04-25T23:38:04Z</dc:date>
    </item>
  </channel>
</rss>

