Select to view content in your preferred language

Join in Model Builder not working when variable is used for table names

1229
3
Jump to solution
08-16-2023 11:35 AM
PeteVitt
Frequent Contributor

Hi - I am joining a feature class with a table in model builder and then trying to export the result to a new feature class.  When I hard-code the layer and table names it works fine. I get complete geometry as well as all of the fields in the attribute table as expected.  When I try to use a variable as part of  the layer and table names, however, the resulting feature class has the correct geometry, but contains only Shape, Shape_Length, and Shape_Area fields. Any idea what could be going wrong?  

My variable is named AgencyName and is also set as a parameter.  I refer to the variable value in my join tool like this: %AgencyName%. Both the input table and the join table are in a fileGDB and are referred to using the complete path  (P:\projects\xxx\OrangeParse.gdb\MSA_%AgencyName%).  I've confirmed the value of my variable name is correct.

Any ideas what could be happening here?  Attached is a screen shot of the model

 

Thanks Pete

1 Solution

Accepted Solutions
PeteVitt
Frequent Contributor

If I use the copy features command instead of export features command it works ok.  The only downside is that the attribute table has the full join field names instead of field aliases

View solution in original post

0 Kudos
3 Replies
PeteVitt
Frequent Contributor

If I use the copy features command instead of export features command it works ok.  The only downside is that the attribute table has the full join field names instead of field aliases

0 Kudos
ShitijMehta
Esri Regular Contributor

Hi, 
Please could you check the field map in the Export Features Tool? I think it does not have the fields from both inputs after join. Try manually adding the fields and their source. See if that works. 
Also, if you are using the Copy Features tool> Open dialog> go to environments tab> search for Qualified field name and uncheck that option and try running it. See if that works.

ShitijMehta
Esri Regular Contributor

We also have new ModelBuilder community page for ModelBuilder questions now https://community.esri.com/t5/modelbuilder-questions/bd-p/modelbuilder-questions

0 Kudos