How to create Print Tool with Custom Layout

71
4
10-21-2020 01:11 PM
Highlighted
New Contributor III

Hello,

I am trying to use a custom layout with the out-of-the-box Web App Builder. I have followed documentation to run the 'Export Web Map' tool from ArcMap, leaving the 'Web Map as Json' parameter blank, as the docs say. I then run the 'Get Layout Templates Info' tool. Then I published the 'Export Web Map' Tool, and in the publish dialog I selected 'Add a Result' and choose the 'Get Layout Templates Info' tool result, per the documentation. The tool publishes without error. I then add a geoprocessing widget to a Web App Builder application. The service has 2 tasks, and only one can be selected. When I enter the url for the service I published "..rest/services/EnergyAtlas2/ExportWebMapAgain/GPServer", into the dialog for the geoprocessing widget, I then have to select one of the tasks, then I can hit 'OK' to create the geoprocessing widget. I've tried making a widget for each task, Get Layout Templates Info, and the Export Web Map tool, and then running the 'Get Layout Templates Info', which appears to run successfully. But how is the output from this task supposed to be input to the Export Web Map tool? I tried to run the Export Web Map geoprocessing widget, but it requires the 'Webmap as JSON' input and I don't know how to get that.   I must be missing something real obvious - can anybody tell me what I'm missing?  Thanks for your help!

Reply
0 Kudos
4 Replies
Highlighted
Esri Contributor

Hi Jacqueline,

Try using the full url to the Export Web Map endpoint (add /Export%20Web%20Map%20Task/execute to your url)

This endpoint should contain the list of templates from the Get Templates operation in the Layout_Template field automatically.

Regards

Reply
0 Kudos
Highlighted
New Contributor III

I tried and get the response 'undefined' for the tool, but it creates a tool widget. However, trying to use the widget gets no response (no error, but no response). Any other suggestions? Thanks!

Reply
0 Kudos
Highlighted
MVP Regular Contributor

It's been a while since doing one of these glorious print task, but have you tried rest/services/EnergyAtlas2/ExportWebMapAgain/GPServer/0?

Reply
0 Kudos
Highlighted
New Contributor III

Thanks - I figured out the problem - I was trying to use the Export Web Map service with a geoprocessing widget, and I needed to use the print widget. Once I switched to the print widget, it worked. Thanks for your help!

Reply
0 Kudos