<?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: ArcPy Scripting Help in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238273#M66223</link>
    <description>&lt;P&gt;Markdown doesn't work here. To format code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1670340168041.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57760i352B875F1030772A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1670340168041.png" alt="JohannesLindner_0-1670340168041.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1670340188604.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57761i8D19A798A700C933/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1670340188604.png" alt="JohannesLindner_1-1670340188604.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you post a screenshot of the error message? That way, we can try to backtrack to where your script fails.&lt;/P&gt;&lt;P&gt;Does your inputfc really have a field called SURVEY_YEAR, and is that field really an integer field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 15:27:44 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-12-06T15:27:44Z</dc:date>
    <item>
      <title>ArcPy Scripting Help</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238239#M66220</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to create a custom tool to use in ArcPro that takes:&lt;/P&gt;&lt;P&gt;1) Input value--the feature class I want to work with&lt;/P&gt;&lt;P&gt;2) Input value--the name of the resulting output feature class from selection&lt;/P&gt;&lt;P&gt;3) Input value--the year in my data set that I want selected and the records copied into a new feature class&lt;/P&gt;&lt;P&gt;I am having trouble with the last part of my script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy


# Setting some variables
inputfc = arcpy.GetParameterAsText(0)
outputfc = arcpy.GetParameterAsText(1)
year_value = arcpy.GetParameter(2)
where_clause = 'SURVEY_YEAR = {0}'.format(year_value)
arcpy.Select_analysis(inputfc, outputfc, where_clause)&lt;/LI-CODE&gt;&lt;P&gt;I get an execute error and it says that my parameters are not valid. I am not sure what is wrong--I am also newish to ArcPy which is why I am struggling with this one.&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;Edit: here's a screenshot of the error message&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="prob.JPG" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57763iDBDEA96FE42A7A21/image-size/large?v=v2&amp;amp;px=999" role="button" title="prob.JPG" alt="prob.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 15:35:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238239#M66220</guid>
      <dc:creator>TaylorBoles1</dc:creator>
      <dc:date>2022-12-06T15:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Scripting Help</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238273#M66223</link>
      <description>&lt;P&gt;Markdown doesn't work here. To format code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1670340168041.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57760i352B875F1030772A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1670340168041.png" alt="JohannesLindner_0-1670340168041.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1670340188604.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/57761i8D19A798A700C933/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1670340188604.png" alt="JohannesLindner_1-1670340188604.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you post a screenshot of the error message? That way, we can try to backtrack to where your script fails.&lt;/P&gt;&lt;P&gt;Does your inputfc really have a field called SURVEY_YEAR, and is that field really an integer field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 15:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238273#M66223</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-12-06T15:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Scripting Help</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238289#M66225</link>
      <description>&lt;P&gt;Thank you. I changed some things around to make it easier to read/work with. Also, yes, the inputfc (the input feature chosen that I am working with) does have a field called SURVEY_YEAR, and that field contains short-numeric int values.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 15:39:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238289#M66225</guid>
      <dc:creator>TaylorBoles1</dc:creator>
      <dc:date>2022-12-06T15:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Scripting Help</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238336#M66226</link>
      <description>&lt;P&gt;Where are the parameters coming from?&lt;/P&gt;&lt;P&gt;Are you using a custom toolbox?&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-tools-in-python.htm" target="_blank"&gt;A quick tour of creating tools with Python—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I would suggest using it since you can associate your parameters in the dialog with those in the script easier and visually&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 16:20:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238336#M66226</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-12-06T16:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy Scripting Help</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238393#M66228</link>
      <description>&lt;P&gt;Put in a line to test if it can find the input file, after line 5, perhaps&lt;/P&gt;&lt;P&gt;if not arcpy.Exists(inputfc): exit(-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next thing I would try is to hard code values and see what happens, testing only the function with three known good inputs, like for example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

# Setting some variables
#inputfc = arcpy.GetParameterAsText(0)
#outputfc = arcpy.GetParameterAsText(1)
#year_value = arcpy.GetParameter(2)
#where_clause = 'SURVEY_YEAR = {0}'.format(year_value)
inputfc = "C:\\some\\file\\path\\survey.shp"
outputfc = "C:\\Temp\\output.shp"
where_clause = "1=1"
arcpy.Select_analysis(inputfc, outputfc, where_clause)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you might be able to narrow it down removing those changes one at a time to see what it's griping about.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 17:49:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-scripting-help/m-p/1238393#M66228</guid>
      <dc:creator>Brian_Wilson</dc:creator>
      <dc:date>2022-12-06T17:49:44Z</dc:date>
    </item>
  </channel>
</rss>

