I have created a simple notebook then published it as a GP tool with 3 output parameters
Notebook code:
from arcgis.gis import GIS
import os
import json
gis = GIS("home")
token = gis.session.auth.token
op_1 = token
op_2 = len(token)
op_3 = json.dumps({"url":"some url"})
# Inserted snippet writes output parameter file for web tool execution
import os
# Only run this snippet during web tool execution when env variable "ENB_JOBID" will be present
if "ENB_JOBID" in os.environ:
out_param_name = "op_1"
out_param_file = os.path.join(
os.environ["ENB_JOBID"], "value_" + out_param_name + ".dat")
with open(out_param_file, "w") as writer:
writer.write(str(op_1))
# Inserted snippet writes output parameter file for web tool execution
import os
# Only run this snippet during web tool execution when env variable "ENB_JOBID" will be present
if "ENB_JOBID" in os.environ:
out_param_name = "op_2"
out_param_file = os.path.join(
os.environ["ENB_JOBID"], "value_" + out_param_name + ".dat")
with open(out_param_file, "w") as writer:
writer.write(str(op_2))
# Inserted snippet writes output parameter file for web tool execution
import os
# Only run this snippet during web tool execution when env variable "ENB_JOBID" will be present
if "ENB_JOBID" in os.environ:
out_param_name = "op_3"
out_param_file = os.path.join(
os.environ["ENB_JOBID"], "value_" + out_param_name + ".dat")
with open(out_param_file, "w") as writer:
writer.write(str(op_3))
The issue is my custom output parameter has no values returned but only the parameter name. Unlike the outputPreview default parameter which has an value associated to it:
the outputPreview parameter does have value: