<?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: Error in using arcpy.SetParameterAsText in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753627#M58151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should start numbering with 0, not 1. Index number 5 does not exist.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2018 16:51:16 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2018-03-22T16:51:16Z</dc:date>
    <item>
      <title>Error in using arcpy.SetParameterAsText</title>
      <link>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753625#M58149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey All,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I am trying to create a derived output using a Python script. when I run the script, I keep getting the following error:&lt;/P&gt;&lt;P&gt;"RuntimeError: Object: Error in setting parameter as text". I have an output folder that is an input (outFolder). I basically want to use that same folder as an output once the script has run so that I can use it in a model.&lt;/P&gt;&lt;P&gt;My parameters are set up like this:&amp;nbsp;&lt;/P&gt;&lt;P style="text-align: left; padding-left: 30px;"&gt;input_FC = arcpy.GetParameterAsText(1)&lt;BR /&gt;inField = arcpy.GetParameterAsText(2)&lt;BR /&gt;theFName = arcpy.GetParameterAsText(3)&lt;BR /&gt;outFolder = arcpy.GetParameterAsText(4)&lt;BR /&gt;output = arcpy.SetParameterAsText(5, outFolder)&lt;BR /&gt;script = sys.argv[0]&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;I have tried several variations of SetParameterAsText, including:&lt;/P&gt;&lt;P style="text-align: left;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;outFolder = arcpy.SetParameterAsText(5, "outFolder")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; and&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; arcpy.SetParameterAsText(5, outFolder)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;My parameter named "output" is configured as such in the script tool properties:&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;IMG alt="Screenshot of my parameter settings" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/399578_params.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is set to derived&amp;nbsp;so that it will appear as an output in a model and obtained from the input parameter, outFolder&amp;nbsp;(Named Feature Class in the parameter settings above). What am I doing wrong here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:45:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753625#M58149</guid>
      <dc:creator>JustinBridwell</dc:creator>
      <dc:date>2018-03-22T16:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error in using arcpy.SetParameterAsText</title>
      <link>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753626#M58150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My first thought to solve this is have the first parameter as text set with an index of 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;input_FC &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&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;
inField &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
theFName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
outFolder &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
output &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameterAsText&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outFolder&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
script &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;argv&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="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;/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;See if that solves it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:59:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753626#M58150</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-12T07:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error in using arcpy.SetParameterAsText</title>
      <link>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753627#M58151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should start numbering with 0, not 1. Index number 5 does not exist.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753627#M58151</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-03-22T16:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error in using arcpy.SetParameterAsText</title>
      <link>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753628#M58152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys- You are both absolutely correct. For whatever reason, I thought that arcpy.SetParameterAsText started its index at 1. This was the crux of my whole problem. It works beautifully now. Thanks so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 19:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753628#M58152</guid>
      <dc:creator>JustinBridwell</dc:creator>
      <dc:date>2018-03-22T19:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error in using arcpy.SetParameterAsText</title>
      <link>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753629#M58153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Justin, i have the same problem now and i have to input it in my thesis defense next week, is it possible to see what the whole of your script looks like?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Adebola&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2018 11:51:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753629#M58153</guid>
      <dc:creator>ADEBOLAHASSAN</dc:creator>
      <dc:date>2018-07-21T11:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error in using arcpy.SetParameterAsText</title>
      <link>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753630#M58154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly seems to be your problem? Post the script here and what your script tool parameters look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 16:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-using-arcpy-setparameterastext/m-p/753630#M58154</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2018-07-26T16:07:40Z</dc:date>
    </item>
  </channel>
</rss>

