<?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 Help me understand how to use ConvertWebMapToArcGISProject! in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/help-me-understand-how-to-use/m-p/267887#M9204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a &lt;A _jive_internal="true" href="https://community.esri.com/thread/245553-alternatives-to-geoprocessing-widget-anyone-ways-to-generate-sample-json-for-testing-gp-service-anyone-else"&gt;separate post&lt;/A&gt; a while back, I was hoping to solicit some guidance&amp;nbsp;on how to use the geoprocessing widget.&amp;nbsp; After&amp;nbsp;some distractions, I'm now returning to this effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have built a few functioning Python tool(boxe)s with ArcGIS Pro now. I understand how to interact with the map layout in Pro to programmatically create PDF of my map and modify the map for&amp;nbsp;conversion to PDF. I am not completely sure how that related to what ESRI calls a "&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;staged layout template." But that has to be similar to what I'm doing.&amp;nbsp;First, I want to replace my aprx reference to a project file with one to a web map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN style="font-size: 15px;"&gt;Memorable ESRI Quote #1&lt;/SPAN&gt;&lt;/H3&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN style="color: #4c4c4c; background: white;"&gt;F&lt;/SPAN&gt;or advanced printing scenarios, you&amp;nbsp;...&amp;nbsp; can use the&amp;nbsp;ConvertWebMapToMapDocument&amp;nbsp;(for&amp;nbsp;ArcMap) or&amp;nbsp;ConvertWebMapToArcGISProject&amp;nbsp;(for&amp;nbsp;ArcGIS Pro) functions in the Python&amp;nbsp;arcpy&amp;nbsp;module.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I am trying to leverage&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ConvertWebMapToArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;webmap_as_json&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;some_wonderful_pdf&lt;SPAN class="operator token"&gt;&amp;gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is no simple way of generating some sample JSON&amp;nbsp;describing your web map that you could use to test your script. So&amp;nbsp;after publishing a script as a geoprocessing service that takes &amp;lt;webmap_as_json&amp;gt; as an argument, how do I pass the json ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can hook Web AppBuilder's Geoprocessing widget into my geoprocessing services but&amp;nbsp;it's needing that JSON to feed on.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/477878_where_the_json_grows.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm&amp;nbsp;inclined to think I'm headed down the wrong path.&lt;/P&gt;&lt;H3&gt;Questions:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;Which widget, if any, can&amp;nbsp;call geoprocessing services and pass along the JSON?&lt;/LI&gt;&lt;LI&gt;Is a "staged layout template" just a PAGX file sitting in a folder registered with my hosting server?&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jan 2020 22:17:10 GMT</pubDate>
    <dc:creator>Arne_Gelfert</dc:creator>
    <dc:date>2020-01-09T22:17:10Z</dc:date>
    <item>
      <title>Help me understand how to use ConvertWebMapToArcGISProject!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/help-me-understand-how-to-use/m-p/267887#M9204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a &lt;A _jive_internal="true" href="https://community.esri.com/thread/245553-alternatives-to-geoprocessing-widget-anyone-ways-to-generate-sample-json-for-testing-gp-service-anyone-else"&gt;separate post&lt;/A&gt; a while back, I was hoping to solicit some guidance&amp;nbsp;on how to use the geoprocessing widget.&amp;nbsp; After&amp;nbsp;some distractions, I'm now returning to this effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have built a few functioning Python tool(boxe)s with ArcGIS Pro now. I understand how to interact with the map layout in Pro to programmatically create PDF of my map and modify the map for&amp;nbsp;conversion to PDF. I am not completely sure how that related to what ESRI calls a "&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;staged layout template." But that has to be similar to what I'm doing.&amp;nbsp;First, I want to replace my aprx reference to a project file with one to a web map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3&gt;&lt;SPAN style="font-size: 15px;"&gt;Memorable ESRI Quote #1&lt;/SPAN&gt;&lt;/H3&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN style="color: #4c4c4c; background: white;"&gt;F&lt;/SPAN&gt;or advanced printing scenarios, you&amp;nbsp;...&amp;nbsp; can use the&amp;nbsp;ConvertWebMapToMapDocument&amp;nbsp;(for&amp;nbsp;ArcMap) or&amp;nbsp;ConvertWebMapToArcGISProject&amp;nbsp;(for&amp;nbsp;ArcGIS Pro) functions in the Python&amp;nbsp;arcpy&amp;nbsp;module.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So I am trying to leverage&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ConvertWebMapToArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;webmap_as_json&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;some_wonderful_pdf&lt;SPAN class="operator token"&gt;&amp;gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There is no simple way of generating some sample JSON&amp;nbsp;describing your web map that you could use to test your script. So&amp;nbsp;after publishing a script as a geoprocessing service that takes &amp;lt;webmap_as_json&amp;gt; as an argument, how do I pass the json ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can hook Web AppBuilder's Geoprocessing widget into my geoprocessing services but&amp;nbsp;it's needing that JSON to feed on.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/477878_where_the_json_grows.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm&amp;nbsp;inclined to think I'm headed down the wrong path.&lt;/P&gt;&lt;H3&gt;Questions:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;Which widget, if any, can&amp;nbsp;call geoprocessing services and pass along the JSON?&lt;/LI&gt;&lt;LI&gt;Is a "staged layout template" just a PAGX file sitting in a folder registered with my hosting server?&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2020 22:17:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/help-me-understand-how-to-use/m-p/267887#M9204</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-01-09T22:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help me understand how to use ConvertWebMapToArcGISProject!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/help-me-understand-how-to-use/m-p/267888#M9205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doing a post-mortem on this before I forget....So I dropped my efforts to use the OTB GP widget, instead, I created a GP tool in ArcGIS Pro (using Python) and&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;ConvertWebMapToArcGISProject&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which allows you to create an in-memory APRX and then massage it to your heart's delight - iterate over maps or layers,&amp;nbsp;choose a pre-configured template, and export that to PDF.&lt;/P&gt;&lt;P&gt;To consume that, I created a custom widget and in it, I did something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; printFromJSON &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            
            &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; currentMap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            
            &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; printTask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;PrintTask&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;PrintParameters&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            params&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; currentMap&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            
            &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; webMapAsJSON &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; printTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;_getPrintDefinition&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;currentMap&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; webMapAsJSONasString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; JSON&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;stringify&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;webMapAsJSON&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; file&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gpParams &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Web_Map_as_JSON"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; webMapAsJSONasString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                             &lt;SPAN class="string token"&gt;"PDFOutputFile"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; file&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;submitJob&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gpParams&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;completeCallback&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;statusCallback&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//Note the "var file" in there‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍. It has to match any output parameters you've configured in your GP tool.‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:07:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/help-me-understand-how-to-use/m-p/267888#M9205</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-11T13:07:33Z</dc:date>
    </item>
  </channel>
</rss>

