Odd Modelbuilder Issue where user needs to close and reopen Arcgis Pro everytime model is run

535
2
03-29-2022 08:58 AM
Labels (2)
JustinBernard1886
New Contributor III

Hi all,

I am somewhat(1 year) new to creating models using Modelbuilder. 

A bit of background,  I created a model that updates two fields in a Land Use feature class with attributes from a Parcels feature class. The LandUse Feature class resides in a FGDB, while the Parcel feature class(created from parcel manager) resides in an enterprise geodatabase, and the user updates a specific area, 1 area at a time.

With that in mind, We're running into a problem that is stumping me. When the user runs the model, the fields are updated correctly. However, when the user moves to the next area to update, the fields will not update correctly. The user actually has to close ArcGIS Pro, reopen, and then run the model to update the next area correctly. 

I am stumped as to why they need to do this. The model itself works fine, but the need to close/reopen the software everytime to run the model is an hindernace to our workflow. Has anyone else experienced this? 

Thanks for the help!

Justin

Tags (2)
0 Kudos
2 Replies
curtvprice
MVP Esteemed Contributor

I'm guessing this issue has to do with a tool that has a field map parameter that is not updating.  The field map gets updated when the model is first validated not at runtime, so if you change the inputs the field map will not refresh to adapt to the new input.

If this is indeed the case the fix is to have the field map calculated using a python function embedded in the Calculate Value tool using the arcpy.fieldmappings() methods. This approach allows the field map to be created/updated at runtime so it will match the inputs, and you will have full control of the output table schema (field list, field types etc). Sorry to say this coding is a little tricky but it does make it possible for field maps to be "portable" to changed model inputs.

Hope this helps at least diagnose the problem and get you started on a solution.

JustinBernard1886
New Contributor III

Thank you so much! 
I'll pass this along to our developer and see what he can do with it. 

Cheers,

Justin

0 Kudos