--- title: "AddJoin" slug: "addjoin" updated: 2023-09-20T16:38:38Z published: 2023-09-20T16:38:38Z canonical: "docs.datajet.app/addjoin" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # AddJoin Creates a join between two tables. Notes - tables must be joined to copy fields, calculate aggregates and perform cross-table data set manipulation. Tables can only be joined on one key at a time, although some engineering methods allow an explicit alternative join to be specified. For more information on joins, see [Joins](/v1/docs/joins) To build multi-layer joins, see [AddJoinLayer](/v1/docs/addjoinlayer). | Key | Value(s) | Description | | --- | --- | --- | | method | "AddJoin" | | | project | "Name of Project" | | | primaryTable | "TableName" | Name of Table on the ONE side of a ONE to MANY Join | | primaryField | "ShortFieldName" | Name of Key Field on the ONE side of a ONE to MANY Join | | foreignTable | "TableName" | Name of Table on the MANY side of a ONE to MANY Join | | foreignField | "ShortFieldName" | Name of Key Field on the MANY side of a ONE to MANY Joina | | fdataset{} | "ForeignTableDataSet" | Added v5.9.16 Optional. Foreign Table dataset. Join will be built from records in the dataset. | ```json { "method": "AddJoin", "primaryTable": "coupon response", "primaryField": "Transaction ID", "foreignTable": "Sales", "foreignField": "Transaction ID", "project": "BulkDecode" } ``` The following builds a join using a filtered dataset on the foreign table: ```json { "method": "AddJoin", "primaryTable": "BikePoints", "primaryField": "commonName_short", "foreignTable": "BikeTripData", "foreignField": "EndStation_short", "project": "BikeData2", "fDataSet": { "logic": "or", "name": "DataSet", "strict": true, "set": [ { "logic": "and", "stype": "FIELD", "entity": { "type": "field", "name": "BikeTripData.Duration", "table": "BikeTripData", "valueFilter": [] }, "op": ">", "values": [ "0" ] } ] } } ```