<?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 Conditional Custom Tool Parameter For Input Layer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623584#M48631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm developing a custom ArcGIS Desktop tool for my Planning department.&amp;nbsp; I want to provide users with an option for which dataset will be used as an input.&amp;nbsp; I want them to be able to select between 1) a layer (shapefile or featureclass) or 2) one ore more tax parcel ids that will be used to construct a feature layer using select by attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially, they will be choosing the layer from which to clip soils.&amp;nbsp; They will either be clipping soils against our tax parcels layer or a special feature class representing a farm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like the tool to only allow for one of these inputs based upon a true/false box parameter.&amp;nbsp; What is the best way to wire this up when creating the custom tool?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Oct 2017 18:51:37 GMT</pubDate>
    <dc:creator>PatrickMcKinney1</dc:creator>
    <dc:date>2017-10-06T18:51:37Z</dc:date>
    <item>
      <title>Conditional Custom Tool Parameter For Input Layer</title>
      <link>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623584#M48631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm developing a custom ArcGIS Desktop tool for my Planning department.&amp;nbsp; I want to provide users with an option for which dataset will be used as an input.&amp;nbsp; I want them to be able to select between 1) a layer (shapefile or featureclass) or 2) one ore more tax parcel ids that will be used to construct a feature layer using select by attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially, they will be choosing the layer from which to clip soils.&amp;nbsp; They will either be clipping soils against our tax parcels layer or a special feature class representing a farm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like the tool to only allow for one of these inputs based upon a true/false box parameter.&amp;nbsp; What is the best way to wire this up when creating the custom tool?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2017 18:51:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623584#M48631</guid>
      <dc:creator>PatrickMcKinney1</dc:creator>
      <dc:date>2017-10-06T18:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Custom Tool Parameter For Input Layer</title>
      <link>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623585#M48632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Layers can be accepted in a tool if the Data Type is set to "Feature Layer". &amp;nbsp;Secondly, if you want to limit the input layer to some specific IDs, I would suggest using a SQL Expression parameter with the Data Type set to "SQL Expression". &amp;nbsp;This can be set to 'Optional' and you can set "Obtained from" to your input feature layer. &amp;nbsp;Just remember to incorporate this in the actual Python code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/376128_pastedImage_1.png" style="width: 325px; height: 195px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2017 19:45:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623585#M48632</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2017-10-06T19:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Custom Tool Parameter For Input Layer</title>
      <link>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623586#M48633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! But that is not the issue I'm having. I want there to be a checkbox that essentially says "Input Farm is from Parcels". If that box is selected, then the user enters in parcel ID numbers.&amp;nbsp; The input dataset for the analysis is then the parcels (which is hard-coded in the script).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If that box is not checked, then they input the location of a feature class representing the farm, which is&amp;nbsp; completely different feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I essentially want input parameters to be conditional based upon a boolean box.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 11:18:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623586#M48633</guid>
      <dc:creator>PatrickMcKinney1</dc:creator>
      <dc:date>2017-10-09T11:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Custom Tool Parameter For Input Layer</title>
      <link>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623587#M48634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick, you could have:&lt;/P&gt;&lt;P&gt;"Input Farm by parcel' &amp;nbsp; &amp;nbsp; as an 'optional' parameter, of integer type&lt;/P&gt;&lt;P&gt;and.....&lt;/P&gt;&lt;P&gt;"or Input Farm location" &amp;nbsp; also as an 'optional' of whatever type you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you just need to check the logic to see which one has a value and which one doesn't and what to do the user inputs neither or both (my preference is to simply output a message and terminate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In basic toolboxes, they don't offer the ability that I think you want since they lack 'event' listening parameters.&amp;nbsp; Ideally,you want a combobox (listbox with 2 choices) rather than a checkbox.&amp;nbsp; You would then have another parameter that allows 'any value' in it.&amp;nbsp; In the combobox, they would select one of two options showing, and enter the 'value' into the second line.&amp;nbsp; Your script would then determine what to do with the 'value' depending on the option chosen.&amp;nbsp; Hard to describe without actually creating one.&amp;nbsp; Maybe python toolboxes offer greater flexibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And finally... since tools are cheap and can reuse scripts, my preference is to have a toolbox with two tools... one for&amp;nbsp;&lt;/P&gt;&lt;P&gt;"input Farm by parcel'&amp;nbsp; and the second "input Farm location" &amp;nbsp; ... very clever ehh &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt; then the user has to decide what to do from the very beginning what they want to do.&amp;nbsp; The scripts process is controlled by the tool they are running it from.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 13:09:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623587#M48634</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-09T13:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Custom Tool Parameter For Input Layer</title>
      <link>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623588#M48635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick, I'm not sure if you have moved on or not, but I think what you want is using the validation&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/customizing-script-tool-behavior.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/customizing-script-tool-behavior.htm"&gt;Customizing script tool behavior—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the past, I know I have been able to enable/disable and/or populate another parameter field based on another, but I struggle with getting the validation to work sometimes, although the sample makes it look rather easy&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/customizing-script-tool-behavior.htm#ESRI_SECTION1_33B6C154C73C477FBF8C4AAEAEA097B9" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/customizing-script-tool-behavior.htm#ESRI_SECTION1_33B6C154C73C477FBF8C4AAEAEA097B9"&gt;to enable or disable a parameter.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2017 20:42:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/conditional-custom-tool-parameter-for-input-layer/m-p/623588#M48635</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-11-01T20:42:35Z</dc:date>
    </item>
  </channel>
</rss>

