Optional parameters Modelbuilder bloc code

351
0
11-30-2017 06:48 AM
JonathanGagnon1
New Contributor

Hi!

I have created a model to automate a task but having difficulty with my optional parameter (variable substitution) with bloc code of my field calculator tool. I want to calculate the field Restrictio only if the user type something in the text box otherwise just pass (keep the current value in the field). Here my model:

The python script:

def UpdateField(value = "%ModRestric%"):
   if value !="":
      return value
   else:
      pass

Thanks for your help

Jonathan

0 Kudos
0 Replies