I'm working in Pycharm Python IDLE under ArcPy, to later work on setting up a toolbox in ArcGIS Desktop 10.7.

I have a large script running in Python that works fine without parameters. Now, I want to create a tool for ArcGIS Desktop 10.7, and have this problem configuring Script Properties. I can't make appear in the next window -'Parameter Properties' > 'Property' = 'Obtained From'-, tables or layers that has been calculated during my tool process, and become like intermediate variables.

I need to recalculate fields in several layers from intermediate data (i need one field from that data), but doesn't appears in the mentioned property like a value, only appears input layers that already get in my hard disk before running process. When I run my tool from ArcMap, in field calculator doesn't appear because, obviously the referenced layer still not processed. But same situation in ModelBuilder it's allowed or better preconfigured.

Do I need to edit my Python code, or is it a configuration problem from 'Script Properties' from ArcMap?

Pair of images, from my script tool, and same situation in ModelBuilder:

  1. My script tool, line blue, that three layers are inputs. Don't show any intermediate data.

enter image description here

  1. Here, what I need to get, those layers with blue symbol processing, but translated in Python and in the script tool

enter image description here

  1. Because in image 2 appears the info from previous layer (loaded fields)

enter image description here

2 Answers 2


When you wire up a script to a tool interface, the interface will have no knowledge of any layers created by the code itself, unless its an output parameter you have specified. As you are creating these layers in your code I would suggest you edit your code to utilise them as it is not possible to access something that does not yet exist.

So to answer your question I would say this is a configuration problem and you need to adapt your code.


After @Hornbydd’s answer, I have created the necessary variables as parameters. In the layer that I need to manipulate, and which is obtained from an intermediate process of the code (and therefore it has not yet been created), I need to create a new field and then edit it using calculate field. To do this, I have used the arcpy.SetParameterAsText function, but it seems that I have not done it correctly. I give you a piece of my code (do not pay attention to the indices of the parameterized variables, they are surely wrong numbered, but I have it controlled):

input_features_2 = out #this one, comes from another previous process 
#output_feature_class_3 = my_gdb + "\\my_layer"
output_feature_class_3 = arcpy.SetParameterAsText(9, my_gdb + "\\my_layer")

vertices_shp = arcpy.FeatureVerticesToPoints_management(input_features_2,

# Proceso: ADD FIELD (1)
input_table_1 = output_feature_class_3 
field_name_1 = "ORIGEN"
field_precision_1 = arcpy.GetParameterAsText(7)  
field_list_1 = arcpy.ListFields(input_table_1)

existe_1 = 0

for field in field_list_1:
    if field.name == field_name_1:
        existe_1 = 1

if existe_1 == 1:
    print "El campo " + field_name_1 + " existe y no es posible añadirlo"
    vertices_shp_2 = arcpy.AddField_management(input_table_1,
# Proceso: CALCULATE FIELD (1)
vertices_prueba = output_feature_class_3`enter code here`
expression_sq1_1 = arcpy.GetParameterAsText(10)   
#expression_sq1_1 = "!Name![0:13]"
vertices_shp_4 = arcpy.CalculateField_management(vertices_prueba,  

In this code, basically I suggest you to pay attention in variable 'output_feature_class_3', it's the one I need to set up and in that way that makes me bring the fields of that layer and makes them appear in the field calculator.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.