Hello,
I am trying to create a web tool that will allow my users (AGOL users) to export a selected feature to a KMZ file. I have it working for the most part but I think i am doing something wrong. The code i am using works (Python) but when i publish it up to ArcServer i am looking for it to give me the layers of the map they are currently on. This part I am not getting to show up correctly. What it is doing right now is it gives me the drop down of the object that i ran the tool with, (Even though I ran it with the parameter input feature of User Defined Value). I want to have the option of my current map as the options.
The process i am doing to publish is Share as on my ArcGIS Enterprise connection > Share as geoprocessing service > select my recently ran tool> name everything accordingly> go into content > input mode i am setting to user defined value and publishing.
what am I doing wrong? Does this make sense as to what I am looking for?
Python Script:
# -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-01-21 10:57:50
"""
import arcpy
from sys import argv
def Model(Input_Feature, Output_File): # ExportToKMZ
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = False
# Process: Make Feature Layer (Make Feature Layer) (management)
Output_Layer = Output_File
arcpy.management.MakeFeatureLayer(in_features=Input_Feature, out_layer=Output_Layer, where_clause="", workspace="", field_info="")
# Process: Layer To KML (Layer To KML) (conversion)
arcpy.conversion.LayerToKML(layer=Output_Layer, out_kmz_file=Output_File, layer_output_scale=0, is_composite="NO_COMPOSITE", boundary_box_extent="DEFAULT", image_size=1024, dpi_of_client=96, ignore_zvalue="CLAMPED_TO_GROUND")
if __name__ == '__main__':
Model(*argv[1:])