The Input Table parameter value can be a feature layer, a table view, or a raster layer with an attribute table. If a data path is used, the layer will be created with the join. The join will always reside in the layer, not with the data.
To make a permanent join, either use the Join Field tool or use the joined layer as input to one of the following tools: Copy Features, Copy Rows, Feature Class To Feature Class, or Table To Table.When saving the results to a new feature class or table, the Qualified Field Names environment can be used to control whether the joined output field names will be qualified with the name of the table the field came from.
If the input is a feature class or dataset path, this tool will automatically create and return a new layer with the result of the tool applied.
The following tables include possible outcomes of performing a join with various inputs.
The first table shows a one-to-many join. Keeping only matching records will not have any affect, as all records have matches.
Input table | Join table | Result |
---|
Input field | Type | Join field | Value | Input field | Type | Join field | Value |
1 | A | 1 | 100 | 1 | A | 1 | 100 |
2 | B | 2 | 200 | 2 | B | 2 | 200 |
| 1 | 300 | 1 | A | 1 | 300 |
2 | 400 | 2 | B | 2 | 400 |
Add Join example: One-to-many join when each table has an Object ID field
The second table uses a join table with no Object ID; only a one-to-first join is possible.
Input table | Join table | Result |
---|
Input field | Type | Join field | Value | Input field | Type | Join field | Value |
1 | A | 1 | 100 | 1 | A | 1 | 100 |
2 | B | 2 | 200 | 2 | B | 2 | 200 |
| 3 | 300 | |
4 | 400 |
Add Join example: One-to-first join when either table does not have an Object ID field
Last, the input table has more records than the join table; keeping all records will keep all of the matching records plus the records from the input table that did not match.
Input table | Join table | Result |
---|
Input field | Type | Join field | Value | Input field | Type | Join field | Value |
1 | A | 1 | 100 | 1 | A | 1 | 100 |
2 | B | 2 | 200 | 2 | B | 2 | 200 |
3 | C | 1 | 300 | 1 | A | 1 | 300 |
4 | D | 2 | 400 | 2 | B | 2 | 400 |
| 3 | C | <Null> | <Null> |
4 | D | <Null> | <Null> |
Add Join Example: One-to-many join when each table has an Object ID field and the Keep All Target Features parameter is checked
The input table must have an Object ID field to perform a one-to-many join.
Records from the join table can be matched to more than one record if the join table has an Object ID field; otherwise, a one-to-first join will be performed.
When joining tables, the default option is to keep all records. If a record in the target table doesn't have a match in the join table, that record is given null values for all the fields being appended into the target table from the join table.
Input table | Join table | Result |
---|
Input field | Type | Join field | Value | Input field | Type | Join field | Value |
1 | A | 1 | 100 | 1 | A | 1 | 100 |
2 | B | 2 | 200 | 2 | B | 2 | 200 |
3 | C | 1 | 300 | 1 | A | 1 | 300 |
4 | D | 2 | 400 | 2 | B | 2 | 400 |
| 3 | C | <Null> | <Null> |
4 | D | <Null> | <Null> |
With the keep only matching records option, if a record in the target table doesn't have a match in the join table, that record is removed from the resultant target table. If the target table is the attribute table of a layer, features that don't have data joined to them are not shown on the map.
Input table | Join table | Result |
---|
Input field | Type | Join field | Value | Input field | Type | Join field | Value |
1 | A | 1 | 100 | 1 | A | 1 | 100 |
2 | B | 2 | 200 | 2 | B | 2 | 200 |
| 3 | 300 | |
4 | 400 |
Field properties, such as aliases, visibility, and number formatting, are maintained when a join is added or removed.
An input table is allowed one join at a time.
The join persists only for the duration of the layer. A layer can be retained by saving the ArcGIS Pro session or by saving it to a layer file using the Save Layer To File tool.
To see the results of a join created in a script tool, the tool must include the layer as a derived output parameter. Similarly, the Updated Input Table parameter must be set as a derived output parameter in a model tool to see the joined results.
In the resulting input table, fields will be prefixed with the input's name and a period (.), and all fields from the join table will be prefixed with the join table name and a period as the default.
- For example, joining landuse, which has fields A and B, to lookup_tab, which has fields C and D, will result in a layer or table view with the following fields: landuse.A, landuse.B, lookup_tab.C, and lookup_tab.D.
Indexing the fields in the input table and join table on which the join will be based can improve performance. If the Index Joined Fields parameter is checked, an attribute index will be added to both joining fields. Alternatively, each joining field can be indexed with the Add Attribute Index tool.
-
If the input layer or table view's fields were modified (renamed or hidden) using the Field Info parameter in the Make Feature Layer or Make Table View tool, the field modifications will not be included in the output joined layer or table view.
The definition query of the join table will be applied to the input layer or table view. The definition query can be removed using the Remove Join tool or by manually removing the definition query from the layer.
The Validate Join tool can be used to validate a join between two layers or tables to determine if the layers or
tables have valid field names and Object ID fields, if the join
produces matching records, is a one-to-one or one-to-many join, and
other properties of the join.
A button to validate the join is available on this tool's dialog box for ease of use.
Any selections on the layer are not used in the Add Join tool but are used in the Join Field tool.