<?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: Server: SetParameter always writing to scratch (I don't want that!) in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/server-setparameter-always-writing-to-scratch-i/m-p/352929#M9362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Baba,&lt;/P&gt;&lt;P&gt;That seems like a very round about way to do what I need. I understand how it 'wants' to work, my issue is that that way (i.e. a temporary file) doesn't fit what I need to do (i.e. a repository of outputs).&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a bit frustrating...I can set the output parameter to a text string representing the proper link to the PDF fine &amp;nbsp;(which doesn't show as a clickable link) but as soon as I change that parameter type to file, it also changes the link to the incorrect location.&lt;/P&gt;&lt;P&gt;What's interesting is that another script I have which does a similar thing (i.e. does some geoprocessing, returns a PDF map) DOES work. I've checked everything in detail to compare but this one refuses to cooperate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2016 19:37:03 GMT</pubDate>
    <dc:creator>GeoNZ</dc:creator>
    <dc:date>2016-11-28T19:37:03Z</dc:date>
    <item>
      <title>Server: SetParameter always writing to scratch (I don't want that!)</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/server-setparameter-always-writing-to-scratch-i/m-p/352927#M9360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've written a geoprocessing script which takes a user drawn AOI from the webmap, does some stuff, then outputs a PDF. The geoprocessing service is accessed through the geoprocessing widget in WebAppBuilder.&lt;/P&gt;&lt;P&gt;The pdfs are&amp;nbsp;written to/stored in a specific directory on our file&amp;nbsp;server as they need to&amp;nbsp;be retrieved for use later through a popup&amp;nbsp;which shows a link to that file (i.e. user clicks on an&amp;nbsp;extent polygon generated each time the tool is run. This shows a popup which gives the details of the PDF map and contains a link to that PDF). In other words, the PDFs are not temporary so writing them to the scratch directory on the server is no what I want to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is, no matter what I try I can't get the output parameter to properly display the link- When the geoprocessing tool finishes through the widget, it displays the link as &amp;lt;HostServer&amp;gt;/arcgis/rest/directories/arcgisjobs/geoprocessors/&amp;lt;geoprocessorName&amp;gt;/&amp;lt;JobID&amp;gt;/scratch/&amp;lt;MyFile.pdf&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The link&amp;nbsp;that I set to the output parameter is (for example):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;FileServer&amp;gt;/SomeDirectory/&amp;lt;MyFile.pdf&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The link/location is valid because &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;a) It is available from the server&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;b) When running the tool before publishing, an addMessage line I've put there gives a string I can paste and access the pdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;c) A&lt;/SPAN&gt;&lt;SPAN&gt;fter the service geoprocess is finished, you can click on the extent polygon and access the pdf through the link written to the attribute table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;No matter what I try I cannot get that link to show as the output parameter after publishing/running as a service! I've tried setting the workspace to my output location in the script and in the environment settings, not setting it etc etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I can't paste screen shots as it's on a disconnected server but:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the relevant python is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;out_PDF = os.path.join(out_folder, 'exampleName.pdf)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy.AddMessage("Exporting PDF: %s" %(out_PDF))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy.mapping.ExportToPDF(mxd,out_PDF,data_frame = "PAGE_LAYOUT"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy.SetParameter(9, str(out_PDF)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the tool parameters, parameter 9 is&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Data Type: File&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Type: Derived&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Direction: Output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MultiValue: No&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Default:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Environment:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Filter: File (.PDF) though have tried this as blank&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Obtained from:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be really appreciated as its been pretty frustrating trying to get something which seems like it should be so easy to work! I just need to display a line of text as a link!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2016 22:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/server-setparameter-always-writing-to-scratch-i/m-p/352927#M9360</guid>
      <dc:creator>GeoNZ</dc:creator>
      <dc:date>2016-11-09T22:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Server: SetParameter always writing to scratch (I don't want that!)</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/server-setparameter-always-writing-to-scratch-i/m-p/352928#M9361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The idea behind a geoprocessing service is that your input data are being transferred to the ArcGIS Server machine where they are processed by geoprocessing and/or custom script tools. The result of this work is being temporarily stored within the arcgisserver directory called arcgisjobs. For each run of the GP service, a folder with an unique GUID name is being created where the&amp;nbsp;file with the printed layers is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My&amp;nbsp;recommendation will be to add an "advice" to the widget.html&amp;nbsp;to your users on where to save the output manually or run a .bat script (task schedule) that will run twice a day to copy (not replace) to your specified folder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Baba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2016 09:15:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/server-setparameter-always-writing-to-scratch-i/m-p/352928#M9361</guid>
      <dc:creator>deleted-user-CQZbjNeBXm49</dc:creator>
      <dc:date>2016-11-10T09:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Server: SetParameter always writing to scratch (I don't want that!)</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/server-setparameter-always-writing-to-scratch-i/m-p/352929#M9362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Baba,&lt;/P&gt;&lt;P&gt;That seems like a very round about way to do what I need. I understand how it 'wants' to work, my issue is that that way (i.e. a temporary file) doesn't fit what I need to do (i.e. a repository of outputs).&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a bit frustrating...I can set the output parameter to a text string representing the proper link to the PDF fine &amp;nbsp;(which doesn't show as a clickable link) but as soon as I change that parameter type to file, it also changes the link to the incorrect location.&lt;/P&gt;&lt;P&gt;What's interesting is that another script I have which does a similar thing (i.e. does some geoprocessing, returns a PDF map) DOES work. I've checked everything in detail to compare but this one refuses to cooperate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 19:37:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/server-setparameter-always-writing-to-scratch-i/m-p/352929#M9362</guid>
      <dc:creator>GeoNZ</dc:creator>
      <dc:date>2016-11-28T19:37:03Z</dc:date>
    </item>
  </channel>
</rss>

