3

I'm using ArcGIS 10. I have a doubt, because I already have a merged shapefile, with two string Fields, some Null and some filled (comes from the merge tool).

So, now I want to get the values from the two string fields into a NEW string Field but with ModelBuilder.

So, I do know how to do it manually and get these values with the FIELD CALCULATOR, because I could choose the field names, but how could I get this prepared for an user with ModelBuilder?

VB Code:

Dim X
if IsNull( [ETIQUETA] ) then
   X = [Data_Hamlet_Galicia_POI_NAME]
else
   X = [ETIQUETA]
end if
__esri_field_calculator_splitter__
X

The FIELDs above may not have the same name, so it will not be right to let this code into the "Field Calculator" Tool within ModelBuilder.

Any suggestions? Here is my model. Model

-------- E D I T ------

Well, @Hornbydd , I've tried but fails, maybe I'm doing something wrong. Here the new model and the error log: Model2

1

Here is one approach:

Your merge output feeds into the model below (i'm calling a layer directly in this example). There is a new variable called "Field" which is of type string and exposed as a parameter.

Model

In the calculate field tool I have the following:

Field calculate

I am using inline substitution to replace the bit of the VB code that would change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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