<?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: Add a confirm dialog box in arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400966#M70172</link>
    <description>&lt;P&gt;Thanks for the reply &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I am using Python toolbox, in that I need a confirm dialog box in between running the script, is that possible?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2024 15:53:12 GMT</pubDate>
    <dc:creator>SumitMishra_016</dc:creator>
    <dc:date>2024-03-26T15:53:12Z</dc:date>
    <item>
      <title>Add a confirm dialog box in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400832#M70168</link>
      <description>&lt;P&gt;I am using arcpy.da.SearchCursor. &lt;STRONG&gt;I want&amp;nbsp;to add a confirm dialog box in arcpy to proceed further&lt;/STRONG&gt;. Can I apply this in arcpy?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 12:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400832#M70168</guid>
      <dc:creator>SumitMishra_016</dc:creator>
      <dc:date>2024-03-26T12:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add a confirm dialog box in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400834#M70169</link>
      <description>&lt;P&gt;I add something like this if I want to remind myself that I'm about to edit or overwrite critical data...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    answer = input("Do you want to continue? (yes/no): ").lower()
    if answer == "yes" or answer == "y":
        print("Continuing...")
        # Add your code here for further execution
    else:
        print("Exiting...")
        sys.exit()&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 Mar 2024 12:28:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400834#M70169</guid>
      <dc:creator>Tom_Laue</dc:creator>
      <dc:date>2024-03-26T12:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add a confirm dialog box in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400950#M70171</link>
      <description>&lt;P&gt;If this is a standalone script that is run manually, then the solution from&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/299157"&gt;@Tom_Laue&lt;/a&gt;&amp;nbsp;should work. Another option to consider is a &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/create-a-python-script-tool.htm" target="_self"&gt;script tool&lt;/A&gt; or &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/a-quick-tour-of-python-toolboxes.htm" target="_self"&gt;Python toolbox&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 15:24:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400950#M70171</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2024-03-26T15:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Add a confirm dialog box in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400966#M70172</link>
      <description>&lt;P&gt;Thanks for the reply &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191789"&gt;@BlakeTerhune&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I am using Python toolbox, in that I need a confirm dialog box in between running the script, is that possible?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 15:53:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1400966#M70172</guid>
      <dc:creator>SumitMishra_016</dc:creator>
      <dc:date>2024-03-26T15:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add a confirm dialog box in arcpy</title>
      <link>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1572955#M73471</link>
      <description>&lt;P&gt;Python toolboxes are able to run validation logic and have appropriate messaging before the script is allowed to excecute. When I find myself in a situation like this where I want the user to be sure everything is correct, I define some initial parameters for validation. In my case, I will check the number of selected records and prevent them from running the tool if there's less than 1 or more than 1000. You can make these checks in the updateMessages() method.&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/writing-messages-in-a-python-toolbox.htm" target="_blank"&gt;Python toolbox messages—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you really need more than a simple warning tooltip next to the input parameter or can't predefine the logic for checking if the situation seems valid, first consider how often people will be using this tool. If regularly, maybe the messaging is enough. You don't want to make a confirmation become a reflexive habit. If you're still looking for a way to slow them down, well, there's not really a good way. You could have a check box at the bottom of the inputs that says something like, "I understand this tool will permanently modify the input data, etc., etc." Then, in the updateMessages() method, put an error message tooltop on it, which prevents the tool from executing.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 21:54:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-a-confirm-dialog-box-in-arcpy/m-p/1572955#M73471</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2025-01-06T21:54:22Z</dc:date>
    </item>
  </channel>
</rss>

