Select to view content in your preferred language

Field Calculator in Model not Batch Processing

594
6
01-24-2023 07:47 AM
CarsonG
Occasional Contributor III

I have a very simple model that calculates a field to give the attachment count of a feature. When I run it as a batch, it does nothing. I am very certain this worked in ArcPro prior to 3.0. I understand some geoprocessing tools no longer can be batched in ArcPro but Calculate Field is not one of them to my knowledge. When I run it solo on a table it works. When I run it batch it says it completed but the fields are not updated. Why will this model not run as a batch with multiple input tables?

CarsonG_0-1674575045615.png

CarsonG_1-1674575054361.png

CarsonG_3-1674575197655.png

 

 

 

0 Kudos
6 Replies
JohannesLindner
MVP Frequent Contributor

You have a table selected in the Calculate Field tool. Try using the variable Input Table:

JohannesLindner_0-1674575953296.png

 


Have a great day!
Johannes
0 Kudos
CarsonG
Occasional Contributor III

This is how I had it set initially. Same results when I set it back to Input Table.

0 Kudos
JohannesLindner
MVP Frequent Contributor

Hmm. Is your model still colored, or is it all grey now? Have you tried rebuilding it?


Have a great day!
Johannes
0 Kudos
CarsonG
Occasional Contributor III

It is greyed out at this point. I have rebuilt it several times.

CarsonG_0-1674577165422.png

 

0 Kudos
JohannesLindner
MVP Frequent Contributor

It works for me, so I'm just spitballing here...

Does it work if you use another, really simple expression?

Let it calculate an integer field to 1 or a text field to Text(Now(), "Y-MM-DD HH:mm:ss")


Have a great day!
Johannes
0 Kudos
CarsonG
Occasional Contributor III

I just had another user create and run the model. It worked for him. At first I thought it was because my model was stored in a .tbx not a .atbx. This did not result in a successful run of the tool.

He created the model in the following location inside the project.

CarsonG_0-1674581964513.png

Once the tool box and model were placed in the project folder it ran successfully. 

I repeated the same process of creating a new .atbx in the Toolboxes folder of the project and then creating the new model. A batch process resulted in fields being populated.

When I tried adding the .tbx which had the original model stored in it to the Toolboxes folder. A batch process would not populate the fields.

When I created a new .atbx outside of the Project Toolboxes folder and then created a new model and tried to batch, this would not update the fields.

When I added the new .atbx to the Project Toolboxes folder and then ran the model as a batch process, it updated the fields correctly for multiple feature classes.

CarsonG_1-1674582477595.png

 

0 Kudos