I am creating a ArcGIS script tool. I set a parameter for the output folder pathway and another parameter for the output gdb name. I want to make verify that if the user rerunning the tool and use the same output gdb name, then the tool validation will show a warning message before they press run that states the gdb already exist in their output folder. If they continue, their previous output gdb will be overwritten. I wrote the script below in the tool validation and received a wrong syntax error when I attempt to open the tool. I tried to rewrite it two ways and received the same error for both ways. How can I rewrite the validation script to resolve the syntax error? Is there a way to join the two parameters and just create one parameter to allow the user to input the output pathway with their output gdb name? Thanks for your help!
def updateMessages(self):
#1st Method
outputGDB = self.params[7] + '/' + self.params[8] +'.gdb'
if self.params[8].value:
workspace = os.path.dirname(outputGDB)
if arcpy.Exists(workspace)
self.params.setErrorMessage = ("The output geodatabase name already exist. Please rename the output geodatabase. Otherwise, it will be overwritten.")
#2nd Method (uncomment the script below)
#outputGDB = self.params[7] + '/' + self.params[8] +'.gdb'
#if self.params[8].value = arcpy.Exists(outputGDB)
#self.params.setErrorMessage = ("The output geodatabase name already exist. Please rename the output geodatabase. Otherwise, it will be overwritten.")
return