Python Tool Box Set Output Parameter for FGDB

362
1
Jump to solution
11-19-2019 04:19 AM
PaulSweeney3
Occasional Contributor III

Hi All see below code which creates a replica of everything added to the layer in the last 7 days and saves to my drive. How do i set this FGDB as a output parameter to be used in model builder for further processing? 


from arcgis.gis import GIS
from arcpy import env
import arcgis.features
gis = GIS("https://XXX.arcgis.com","XXX","XXX")




url = 'https://services8.arcgis.com/XXX/arcgis/rest/services/XXX/FeatureServer'
Digs = arcgis.features.FeatureLayerCollection(url, gis)




Digs.properties.capabilities


result = Digs.replicas.create(replica_name='Excavations',
layers=[0],
layer_queries = {"0":{"queryOption": "useFilter", "where": "CreationDate >= CURRENT_DATE-1"}},
return_attachments=True,
attachments_sync_direction='bidirectional',
wait=True,
data_format="filegdb",
asynchronous=True,
out_path='T:\\GIS Files\\XXX')




arcpy.SetParameter(1, result)



0 Kudos
1 Solution

Accepted Solutions
PaulSweeney3
Occasional Contributor III

Figured it out 

 out_path=arcpy.GetParameterAsText(0)),

then configure the parameter setting in the properties of the tool 

View solution in original post

0 Kudos
1 Reply
PaulSweeney3
Occasional Contributor III

Figured it out 

 out_path=arcpy.GetParameterAsText(0)),

then configure the parameter setting in the properties of the tool 

0 Kudos