Problem with "Join Field" tool in Modelbuilder (iterators & submodels)

5672
27
Jump to solution
05-21-2015 06:01 AM
KONPETROV
Occasional Contributor III

Hello, in my problem i have used "sample tool" for a group of points, with the help of an iterator at modelbuilder and with the use of an inline variable. All i want to do is to join my tables with my points but i don't have a common column. So i created a tool to add a column to both of my groups (tables and point f.classes)

So what i did was that. I created two submodels which contain an iterator for tables (the first one) and (the second) an iterator for point fclasses and a connection to my tool which adds a common column to both of them wih the same values 0,1,2,3,4... so as to join them later, and i used an inline variable again for these submodels. My problem is that when i create a new model with these two submodels inside, although i can put their outputs in the boxes "Input table" & "Join Table" , there isn't any column to choose to join them at "Input Join Field"  & "Output Join Field".

Please any help would be much appreciated. Thank you very much.

27 Replies
ToddBlanchette
Occasional Contributor II

When you try to join the results from your sub-model to the Join Field tool as a parameter, does it not ask you what input parameter you would like to use that for?  Ex: join your shapefile output to the Join Field tool, set as parameter and click on Input Table.  Do the same for your output table, set as input parameter for the tool, and click on Table to Join.

KONPETROV
Occasional Contributor III

I did it that way and as before i first get a message like in the following image i press ok and when i am pressing the button to run, the result is the same as the errors i wrote below image2.jpg

0 Kudos
SepheFox
Frequent Contributor

Can you explain what field you are sorting on that puts the two tables into the same order?

KONPETROV
Occasional Contributor III

i sorted a column in a previous precedure to have my tables in the form i want, it hasn't any infuelnce to what i am doing now. It isn't something so hard but i cannot think what the problem is.

0 Kudos
SepheFox
Frequent Contributor

Ok, I'm just not sure that any previous sorting you did will be used in this procedure, for one thing. Since this method clearly isn't working, Todd and I are both looking at the bigger picture of your entire process to see if there is abetter way to get it done, so you don't have to keep hitting your head into the same brick wall.

0 Kudos
SepheFox
Frequent Contributor

Hi Kon, you won't find the field you're looking for in the drop down of the dialog box, because you're using an inline variable, the model doesn't know in advance the exact feature class it is processing. You can just type the name of the field into the dialog.

KONPETROV
Occasional Contributor III

REALLY??????? Will it select all fields also? Because i cannot click "Select All"!

0 Kudos
KONPETROV
Occasional Contributor III

No it cannot be done, just tried it. And i got

ERROR 000622: Failed to execute (JoinField). Parameters are not valid.

ERROR 000732: Input Table: Dataset C:\Win\Sik\Points\fid_%Name%.shp does not exist or is not supported

ERROR 000732: Join Table: Dataset C:\Win\Sik\Tables\f2%Name% does not exist or is not supported

0 Kudos
SepheFox
Frequent Contributor

I don't understand why you are using iterate feature classes and tables, instead of iterate feature or row selection. Also, do you have overwrite ouptut set to true in the geoprocessing environments?

0 Kudos
KONPETROV
Occasional Contributor III

the overwrite no, how can i  do that?

if i use iterate feature or row selection what is the difference? in a model i can have only one iterator, or you mean something for the sub?

0 Kudos