<?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: Problem with output paramater in script tool - Does not work in model builder! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731378#M56739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not sure why you are using the last parameter as derived&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Oct 2017 20:13:53 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-10-20T20:13:53Z</dc:date>
    <item>
      <title>Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731377#M56738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a bit of a problem with a python script tool that I am trying to get to work when I chain it to other tools in a model made in model builder. It's just a simple dummy tool I set up to try to sort things out, the model selects a polygon, based on user input via a point type feature set, and buffers this selected polygon (this is the script part) then I wanted to copy the result output (featureclass) to another location by chaining the script tool to the copy features tool but no matter what I try it gives me an error that an input value is required (see model diagram, script tool parameter settings and script tool code below). Script tool runs fine on it's own by the way and gives proper results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Model diagram:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="379882" alt="Copy buffered poylys model diagram" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/379882_Capture.PNG" style="width: 620px; height: 184px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Mybuffers Script tool code:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy
import os
from arcpy import env

#Set environement variables

scratch = env.scratchGDB
env.overwriteOutput = True
arcpy.SetLogHistory(False) #Important to reduce metadata writing

#Get input parameters

inpnt = arcpy.GetParameterAsText(0)
mypolys = arcpy.GetParameterAsText(1)
outfcname = os.path.join(scratch, "mybuffers")

#Make feature layer from input point(s)

inpntlyrname = "InputPoints"
inpntlyr = arcpy.MakeFeatureLayer_management(inpnt, inpntlyrname)

#Make feature layer from polygons

polylyrname = "MyPolygons"
polylyr = arcpy.MakeFeatureLayer_management(mypolys, polylyrname)

#Select polygons that intersect input points

selpolys = arcpy.SelectLayerByLocation_management(polylyr, "INTERSECT",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inpntlyr, "25 Meters", "NEW_SELECTION")

#Buffer selected polygons

arcpy.Buffer_analysis(selpolys, outfcname, "5000 Meters")

#Set output parameter

outputfc = arcpy.SetParameterAsText(2, outfcname)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;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;/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;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;/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;&lt;STRONG&gt;&lt;EM&gt;Mybuffers script tool parameters settings (for the output parameter):&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="379883" alt="Mybuffers output parameter settings" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/379883_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's like the copy features tool is not getting the data from the script tool even though I've used countless different versions of the SetParameterAsText() and read as much as I can take of the official help. Perhaps there is some good hearted soul willing to look over my code to help me see where I'm going wrong because I'm stuck and getting really annoyed at this &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE 23.10.2017:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been relying on the official help in the link below, chapter heading "Derived output that does not modify an input parameter". I have now tested setting up exactly the same example with the post data to repository script tool and the copy features section of the model fails in the exact same way i.e. "input value required", the second tool in the chain does not run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/381034_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/setting-script-tool-parameters.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/setting-script-tool-parameters.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Setting script tool parameters—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:13:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731377#M56738</guid>
      <dc:creator>BogiBjornsson</dc:creator>
      <dc:date>2021-12-12T07:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731378#M56739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not sure why you are using the last parameter as derived&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 20:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731378#M56739</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-10-20T20:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731379#M56740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using derived so as not to allow user input for that parameter, basically hiding it from the tool dialog box. I could hard code the parameter inside the script but then I would not get an output which I can subsequently use to chain the script tool in model builder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 10:30:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731379#M56740</guid>
      <dc:creator>BogiBjornsson</dc:creator>
      <dc:date>2017-10-23T10:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731380#M56741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&amp;nbsp;&lt;SPAN style="color: #8b8b8b; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A _jive_internal="true" class="" data-userid="10938" data-username="bogibrynjar" href="https://community.esri.com/people/bogibrynjar" style="color: #3778c7; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: underline; font-size: 13.7136px;"&gt;Bogi Bjornsson&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I Do not know if you are still searching for the answer, but in mubuffer properties window, i see the properties&lt;/P&gt;&lt;P&gt;type: derived&amp;nbsp;&lt;/P&gt;&lt;P&gt;Direction : output&lt;/P&gt;&lt;P&gt;Obtained from : blank&amp;nbsp;&lt;/P&gt;&lt;P&gt;may be you can try setting&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obtained from : Feature Set . i.e input&lt;/P&gt;&lt;P&gt;derived output is obtained from input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 16:09:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731380#M56741</guid>
      <dc:creator>JeevanBasnyat</dc:creator>
      <dc:date>2018-03-14T16:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731381#M56742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="output : obtained from  in_features" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/398829_answer.PNG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 16:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731381#M56742</guid>
      <dc:creator>JeevanBasnyat</dc:creator>
      <dc:date>2018-03-14T16:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731382#M56743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the input but unfortunately it is not the answer. In the chapter &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/creating-tools/setting-script-tool-parameters.htm"&gt;Setting script tool parameters&lt;/A&gt; there is a section called "&lt;STRONG&gt;&lt;EM&gt;Derived output that does not modify an input parameter&lt;/EM&gt;&lt;/STRONG&gt;". There it specifically states that this parameter "Obtained from" should be empty (see snapshot below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-centered j-img-original" src="https://community.esri.com/legacyfs/online/399592_Capture.PNG" style="width: 620px; height: 582px; display: block; margin-left: auto; margin-right: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2018 12:19:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731382#M56743</guid>
      <dc:creator>BogiBjornsson</dc:creator>
      <dc:date>2018-03-23T12:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731383#M56744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" class="" data-userid="10938" data-username="bogibrynjar" href="https://community.esri.com/people/bogibrynjar" style="color: #8ca9cd; background-color: #ffffff; border: 0px; font-weight: 600; text-decoration: none; font-size: 13.7136px;"&gt;Bogi Bjornsson&lt;/A&gt;&amp;nbsp;any resolution to this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2019 23:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731383#M56744</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-05-17T23:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731384#M56745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately not, no solution has been found.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2019 07:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731384#M56745</guid>
      <dc:creator>BogiBjornsson</dc:creator>
      <dc:date>2019-05-20T07:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731385#M56746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also have this issue and just posted a similar question (before I saw your post).&amp;nbsp; I still dont understand why the SetParameterAsText doesnt work, but think I found a work around that allows me to use the derived output from the script tool in subsequent Model Builder.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I ended up doing was using the 'Calculate Value' tool in model building to build the name of the feature class.&amp;nbsp; I linked the derived output as a precondition.&amp;nbsp; In my case my script tool used the 'Create Feature Class' tool based on user input of workspace and output feature class name.&amp;nbsp; The script tool created and populates the resultant feature class. &amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on your example I think this approach will work.&amp;nbsp; Just note that the 'Calculate Value' tool uses some pretty funny syntax - for strings you have to enclose them in "" in addition to the in-line variables %.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are some screenshots.&amp;nbsp;&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/454694_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/454695_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 01:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731385#M56746</guid>
      <dc:creator>NealBanerjee</dc:creator>
      <dc:date>2019-07-30T01:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with output paramater in script tool - Does not work in model builder!</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731386#M56747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting workaround, I will try it next time I'm having this problem. Thank you for sharing your solution! &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 09:18:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-output-paramater-in-script-tool-does/m-p/731386#M56747</guid>
      <dc:creator>BogiBjornsson</dc:creator>
      <dc:date>2019-07-30T09:18:11Z</dc:date>
    </item>
  </channel>
</rss>

