Select to view content in your preferred language

Model runs in ModelBuilder but returns with error when run as Geoprocessing tool

352
0
01-11-2024 10:17 PM
DiDi_ESRI
New Contributor

My model has an input parameter of 'Study Area' connected to a "If field exists" where it checks whether the field 'Area_HA' exists. If not, then add the field before proceeding with an intersect tool.

The input Study Area (which has the field) and the output of the add field (which should not proceed since the check is false) are then fed into a "merge branch" so I have a single output variable that I can name and connect to the other processes, whether the Area field already exists or needed to be added.

In this case, my test shape does indeed have an "Area_HA" field, so 'if field exists" would be set to true and it would continue on with everything else down the line. 

The tool runs perfectly in the ModelBuilder tab, and exports all the necessary output to the places I want them to be.

However, when I open it in the Geoprocessing pane, the model fails to run, returning the error that "Area_HA" field exists. Which to me indicates that the "if field exists" check does not do anything, or is not working as I intended it to. Alternatively, my understanding of a merge branch is not correct.

I tried exporting the model to ArcPy to have a better look at the script and it does not tell me much either. 

I've also tried closing the project I am working on and opening the model again, running it on the geoprocessing pane immediately (a fix that worked for someone with a similar issue elsewhere). That did not work either. 

0 Kudos
0 Replies