I need to Calculate a Field with modelbuilder, but first I want to make a join with 2 tables, and only after that join I have the parameters to calculate the field. While constructing the model I need to write the expression to calculate the field but I don't have the fields that I need yet because I still didn't make the join. How do I solve this?
-
Have you tried adding a Feature Class to Feature Class stage after the join?MyFamily– MyFamily2015年06月03日 14:35:41 +00:00Commented Jun 3, 2015 at 14:35
2 Answers 2
This is a limitation of model builder, a real chicken and egg problem! You can do one of two things:
- If the model is "static" in that it's always the same tables being joined then you can simply write the field calculate expression. Don't bother trying to use the interface just type it in. You will need to be careful with the syntax structure and included the table name. I would create create the joins manually pretend to do a field calculate and build the expression and copy that down then add that to the field calculate in the model.
- Another way is to build you model with the joins, run that so the model elements are shaded to show that you have executed them THEN add the field calculate tool to model builder connect it and you should see all the fields to build the field calculate expression.
-
I'll pick the second option. But every time that I run the model i'll have to do that? Run only with join and then add the field calculate tool?AndM– AndM2015年06月04日 11:36:20 +00:00Commented Jun 4, 2015 at 11:36
In the Model Builder, run only the join operation. The needed fields will be available in the output data for running your Field Calculation.