<?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 Using the Field Mapping data type as a parameter for a script tool? in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/using-the-field-mapping-data-type-as-a-parameter/m-p/422005#M2822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a script tool, and I'd like to use the &lt;STRONG&gt;Field Mappings&lt;/STRONG&gt; data type for my 2nd parameter (1st parameter is a Feature Class, Table, etc.).&amp;nbsp; &amp;nbsp;It seems like this type of parameter should have the &lt;STRONG&gt;Obtained from&lt;/STRONG&gt; property enabled, but I cannot find a data type, for use with the 1st parameter, that enables the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Obtained from&lt;/STRONG&gt; property.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;While trying to troubleshoot the issue, I place code in the updateParameters validation function that logs debug messages to a text file.&amp;nbsp; When I try to find the data type of the Field Mappings parameter, using the type() function with self.params[1].value or&amp;nbsp;self.params[1], I get:&amp;nbsp;&lt;STRONG&gt;&amp;lt;type 'NoneType'&amp;gt;&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone please explain how to use the Field Mapping data type with a script tool?&amp;nbsp; Specifically, I'd like to know how to populate the control associated with the&amp;nbsp;Field Mappings data type.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Aug 2019 23:14:53 GMT</pubDate>
    <dc:creator>ShaneReed</dc:creator>
    <dc:date>2019-08-21T23:14:53Z</dc:date>
    <item>
      <title>Using the Field Mapping data type as a parameter for a script tool?</title>
      <link>https://community.esri.com/t5/developers-questions/using-the-field-mapping-data-type-as-a-parameter/m-p/422005#M2822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a script tool, and I'd like to use the &lt;STRONG&gt;Field Mappings&lt;/STRONG&gt; data type for my 2nd parameter (1st parameter is a Feature Class, Table, etc.).&amp;nbsp; &amp;nbsp;It seems like this type of parameter should have the &lt;STRONG&gt;Obtained from&lt;/STRONG&gt; property enabled, but I cannot find a data type, for use with the 1st parameter, that enables the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;Obtained from&lt;/STRONG&gt; property.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;While trying to troubleshoot the issue, I place code in the updateParameters validation function that logs debug messages to a text file.&amp;nbsp; When I try to find the data type of the Field Mappings parameter, using the type() function with self.params[1].value or&amp;nbsp;self.params[1], I get:&amp;nbsp;&lt;STRONG&gt;&amp;lt;type 'NoneType'&amp;gt;&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone please explain how to use the Field Mapping data type with a script tool?&amp;nbsp; Specifically, I'd like to know how to populate the control associated with the&amp;nbsp;Field Mappings data type.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2019 23:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/using-the-field-mapping-data-type-as-a-parameter/m-p/422005#M2822</guid>
      <dc:creator>ShaneReed</dc:creator>
      <dc:date>2019-08-21T23:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Field Mapping data type as a parameter for a script tool?</title>
      <link>https://community.esri.com/t5/developers-questions/using-the-field-mapping-data-type-as-a-parameter/m-p/422006#M2823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;field mapping might be derived from the featureclass/table since more that one field is potentially involved.&amp;nbsp; See if that enables the fields&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/setting-script-tool-parameters.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/setting-script-tool-parameters.htm"&gt;Setting script tool parameters—Geoprocessing and Python | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2019 23:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/using-the-field-mapping-data-type-as-a-parameter/m-p/422006#M2823</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-08-21T23:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using the Field Mapping data type as a parameter for a script tool?</title>
      <link>https://community.esri.com/t5/developers-questions/using-the-field-mapping-data-type-as-a-parameter/m-p/422007#M2824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you're referring to the 1st parameter...I've tried feature class, table, table view, etc., but no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to use the 1st (data type is FC) and the code below, placed in the updateParameters function, to initialize a FieldMapping object:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;altered&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;params&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;value
    fms &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldMappings&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    fms&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;After the code above runs, I can iterate over fms to confirm that it has a collection of valid FieldMap objects&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/using-the-field-mapping-data-type-as-a-parameter/m-p/422007#M2824</guid>
      <dc:creator>ShaneReed</dc:creator>
      <dc:date>2021-12-11T19:04:32Z</dc:date>
    </item>
  </channel>
</rss>

