<?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: Python tool hasBeenValidated is always False in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695920#M53943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don, there is a fuzzy section on tool validation code for web tools.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/share-analysis/authoring-web-tools-with-python-scripts.htm" title="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/share-analysis/authoring-web-tools-with-python-scripts.htm"&gt;Authoring web tools with Python scripts—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whether it applies seems to depend on what you are trying to validate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2020 02:57:48 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2020-02-25T02:57:48Z</dc:date>
    <item>
      <title>Python tool hasBeenValidated is always False</title>
      <link>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695918#M53941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've developed a number of python toolbox tools and my latest has a problem that I can't figure out.&amp;nbsp; It works fine when I run it from my ArcPro tool folder, but not when it is run as a shared&amp;nbsp;geoprocessing package downloaded from ArcGIS Online&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After inserting log statements I see that the root of the problem is that the hasBeenValidated setting on the input parameters is always False for all of the parameters. Nothing I do in the UI results in a True setting. I have 2 parameters that interact based on hasBeenValidated. When parameter A has not been validated, I repopulate the list associated with parameter B and set its value to the first element in the list.&amp;nbsp; But since parameter A always shows up a not validated, it is impossible to make stick any change to parameter B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is only happening in 2 of my tools - the unique thing about them is that parameter A is a GPFeatureLayer.&amp;nbsp; These are the only 2 tools with that type of parameter.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;hasBeenValidated is a readonly value so I don't see how anything I do has any control over it&amp;nbsp;but without it I don't see how I can make the tool work correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; "&gt;I'm running this&amp;nbsp;on&amp;nbsp;ArcPro&amp;nbsp; 2.4.3&amp;nbsp; and Python 3.6.8 and Advanced license.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2020 14:45:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695918#M53941</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2020-02-24T14:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool hasBeenValidated is always False</title>
      <link>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695919#M53942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I went back and checked and hadBeenValidated is never True for any parameter in any of my shared tools.&amp;nbsp; So forget about the speculation that it has something to do with the GPFeatureLayer parameter.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 01:30:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695919#M53942</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2020-02-25T01:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool hasBeenValidated is always False</title>
      <link>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695920#M53943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don, there is a fuzzy section on tool validation code for web tools.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/share-analysis/authoring-web-tools-with-python-scripts.htm" title="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/share-analysis/authoring-web-tools-with-python-scripts.htm"&gt;Authoring web tools with Python scripts—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whether it applies seems to depend on what you are trying to validate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 02:57:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695920#M53943</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-25T02:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool hasBeenValidated is always False</title>
      <link>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695921#M53944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan - I just read through that - fuzzy indeed. This particular tool is being packaged as a "geoprocessing package" - so instead of running on the server, I upload it to ArcGIS Online where users can download it and run it on their ArcPro desktop. It has its own consolidation and validation quirks just like the web tools which run on the server.&amp;nbsp; I've been doing some more digging and I see that &lt;SPAN&gt;geoprocessing&amp;nbsp;&lt;/SPAN&gt;package that I build includes both the original code (.pyt and .py files) plus a .tbx file which I believe is a "custom toolbox".&amp;nbsp; It's when I run the tool out of the custom toolbox that the hasBeenValidated setting is never set to True.&amp;nbsp; When I run the tool out of the original code it works OK.&amp;nbsp; Tomorrow I'm attending a 2-day ESRI Midwest User Conference - maybe I can track somebody down that can explain this.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 03:30:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695921#M53944</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2020-02-25T03:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool hasBeenValidated is always False</title>
      <link>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695922#M53945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ESRI team confirmed that this is a bug. The hasBeenValidated attribute is not set correctly when a tool is run from a geoprocessing package. I'm waiting to see if I can get a bug number for tracking.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was actually able to workaround it by saving&amp;nbsp; the parameter values in a global space when exiting updateParameters. Then on the next call to updateParameters I do two things:&lt;/P&gt;&lt;P&gt;1) for those parameters that might change, I compare the incoming parameter value to the saved value to determine if it changed&lt;/P&gt;&lt;P&gt;2) for the filter lists (the user can not change these) I restore the incoming parameter value to the saved value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can explain more if anybody is really interested&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2020 23:41:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-tool-hasbeenvalidated-is-always-false/m-p/695922#M53945</guid>
      <dc:creator>DonMorrison1</dc:creator>
      <dc:date>2020-03-01T23:41:51Z</dc:date>
    </item>
  </channel>
</rss>

