<?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: Field mapping syntax (python) in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542147#M18031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been corresponding with ESRI support. They said:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"...I also suspect the &lt;/SPAN&gt;&lt;STRONG&gt;9.2&lt;/STRONG&gt;&lt;SPAN&gt; script tool is not liking the value table for some yet unknown reason.&amp;nbsp; I couldn't find any bugs reported for this, so at least there is hope for us..."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Append_management(vt, outfc, "NO_TEST", fieldmappings)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this worked in pythonwin using a valid argument but as a script in arctoolbox92 I got this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Inputs must be either all FeatureClasses, Tables or Rasters; not mixed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Append)."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Based on this error I found a solution (for 92 and python24). I removed any reference to value tables, while keeping fieldmappings and fieldmap and I just used my input featureclass for the Append so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Append_management(fc, outfc, "NO_TEST", fieldmappings) # this works&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Append_management(vt, outfc, "NO_TEST", fieldmappings) # see error above&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope it helps others!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jul 2010 20:11:21 GMT</pubDate>
    <dc:creator>SimonWillis</dc:creator>
    <dc:date>2010-07-08T20:11:21Z</dc:date>
    <item>
      <title>Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542140#M18024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok so what is the syntax for field mapping? In tools that require fields to be mapped I have figured out what most of each field needs to be, but not all of it. In this example from a Spatial Join this is one field:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;A1RENUM 'A1RENUM' true true false 15 Text 0 0 ,First,#,C:\\GIS Projects\\CRW\\TrakIt_Source_RS.gdb\\Target_Data\\parce_test_FeatureToPoint.shp,A1RENUM,-1,-1&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The syntax is: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NewFieldName 'NewFieldAlias' ? ? ? NewFieldLength NewFieldType ? ?, MergeRule, MergeDelimeter, SourcePath, SourceFieldName, ? , ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NewField is the field in the table created by the tool. MergeDelimeter is # if you arent using the Join merge rule. What I want to know is what True True False, 0 0 , and -1,-1 are doing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 14:04:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542140#M18024</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-04-22T14:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542141#M18025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A little late but here I found some good info:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1729&amp;amp;t=207100#678774"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1729&amp;amp;t=207100#678774&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jun 2010 19:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542141#M18025</guid>
      <dc:creator>SimonWillis</dc:creator>
      <dc:date>2010-06-23T19:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542142#M18026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HA! Thanks. Its funny that someone else asked the exact same thing I did.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jun 2010 11:49:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542142#M18026</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-06-24T11:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542143#M18027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you ever get it to work? I have also been using the fieldmapping/fieldmap object and I keep bombing in pywin... I even took a couple of steps back to make the fieldmapping example work in arctoolbox - Merge (Data Management). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's similar to arcgis10 arcpy fieldmapping example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/FieldMappings/000v0000008q000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/FieldMappings/000v0000008q000000/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;I still can't get it to work!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jun 2010 18:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542143#M18027</guid>
      <dc:creator>SimonWillis</dc:creator>
      <dc:date>2010-06-24T18:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542144#M18028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I ended up using the tool in catalog to set it all up. I just went back and did a find-replace to change the file paths. Much quicker than typing all of it. I have a spatial join in one script that is 20685 characters long, most all of it is field mapping. I wrote papers shorter than that in college.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jun 2010 20:00:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542144#M18028</guid>
      <dc:creator>ChrisMathers</dc:creator>
      <dc:date>2010-06-24T20:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542145#M18029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I finally got the fieldmapping object to work and it works great to append a shp to SDE in pythonwin2.5 but attached as a script in arctoolbox it bombs out and complains about:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PYTHON ERRORS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback info:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\temp\SplitProcessImport063010.py", line 266, in ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import2SDE(UpdWorkspace, outputUpdFC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error Info:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(-2147467259, 'Unspecified error', None, None)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geoprocessing ERRORS:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Inputs must be either all FeatureClasses, Tables or Rasters; not mixed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Append).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I think it may like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Append the value table (from shp) into the SDE feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Append_management(vt, outfc, "NO_TEST", fieldmappings)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in pythonwin but hate this statement in the arctoolbox script??? I know I am importing point features only - so not mixing different different datasets!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jul 2010 17:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542145#M18029</guid>
      <dc:creator>SimonWillis</dc:creator>
      <dc:date>2010-07-06T17:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542146#M18030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So it looks like this may be a bug that has existed since 2007 *gasp*&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1729&amp;amp;t=223204" rel="nofollow"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1729&amp;amp;t=223204&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI / dear Jack, if you read this, are we moving on this or not? It seems the problem still exists in 931 ... do I dare ask about 10?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, at least Holland in the world cup final...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: &amp;quot;orange&amp;quot;; font-size: &amp;quot;4&amp;quot;; font-family: &amp;quot;Verdana&amp;quot;;"&gt;Hup Holland Hup!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jul 2010 14:41:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542146#M18030</guid>
      <dc:creator>SimonWillis</dc:creator>
      <dc:date>2010-07-07T14:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542147#M18031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been corresponding with ESRI support. They said:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"...I also suspect the &lt;/SPAN&gt;&lt;STRONG&gt;9.2&lt;/STRONG&gt;&lt;SPAN&gt; script tool is not liking the value table for some yet unknown reason.&amp;nbsp; I couldn't find any bugs reported for this, so at least there is hope for us..."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Append_management(vt, outfc, "NO_TEST", fieldmappings)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this worked in pythonwin using a valid argument but as a script in arctoolbox92 I got this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Inputs must be either all FeatureClasses, Tables or Rasters; not mixed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Append)."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Based on this error I found a solution (for 92 and python24). I removed any reference to value tables, while keeping fieldmappings and fieldmap and I just used my input featureclass for the Append so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Append_management(fc, outfc, "NO_TEST", fieldmappings) # this works&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Append_management(vt, outfc, "NO_TEST", fieldmappings) # see error above&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope it helps others!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jul 2010 20:11:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542147#M18031</guid>
      <dc:creator>SimonWillis</dc:creator>
      <dc:date>2010-07-08T20:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542148#M18032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I ended up using the tool in catalog to set it all up. I just went back and did a find-replace to change the file paths. Much quicker than typing all of it. I have a spatial join in one script that is 20685 characters long, most all of it is field mapping. I wrote papers shorter than that in college.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That is how I create field maps too, but you can set the workspace to shorten the paths to fit the fieldmap string into one line.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 08:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542148#M18032</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2010-07-13T08:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542149#M18033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Another update. This comes from ESRI again&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Another one of our analysts here previously had a similar issue and logged the following software bug:&lt;BR /&gt;&lt;BR /&gt;[NIM002716; Some geoprocessing tools that take in a value table argument are not honoring gp.workspace command when run as script tools in ArcToolbox]&lt;BR /&gt;&lt;BR /&gt;There is a possible workaround listed that I would like to you to please try at your convenience.&amp;nbsp; For the Append tool value table input, please try specifying the full paths to the data when adding rows to the value table.&amp;nbsp; According to the bug, this may allow it to work when added as a script tool.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This workaround worked for me!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So first I had:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;vt.AddRow(fc) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and I changed it to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bugfixfc = SHPworkspace + "\\" + fc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;vt.AddRow(bugfixfc) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# back to using vt and append works!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;gp.Append_management(vt, outfc, "NO_TEST", fieldmappings)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 17:24:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542149#M18033</guid>
      <dc:creator>SimonWillis</dc:creator>
      <dc:date>2010-07-13T17:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Field mapping syntax (python)</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542150#M18034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I too struggled with this. Please see the following link &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/34881-replacefieldmap()-appears-broken-in-arcpy"&gt;http://forums.arcgis.com/threads/34881-replacefieldmap()-appears-broken-in-arcpy&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Susan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jul 2011 03:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-mapping-syntax-python/m-p/542150#M18034</guid>
      <dc:creator>SusanJones</dc:creator>
      <dc:date>2011-07-23T03:19:19Z</dc:date>
    </item>
  </channel>
</rss>

