# Match and Map - Record matching

Record matching is the process of deciding which record or set of records need to be updated.

Matching in Inaport is a two step process:

1. Relationships specify the primary key and foreign key joins between the parent and child table
   The relationships are used first to identify the set of child records that will be matched
2. Matching specifies expressions for the source and target record that must evaluate equal for the records to match
   Once the correct set of child records have been identified, the matching is used to select which record to target

### Relationships

When you add tables to the tree view, you specify which tables are parents and which are children. Inaport will normally automatically provide the primary key an foreign key expressions that indicate how the tables are joined.

If the expressions have not been provided, you will need to enter them using the Expression Editor. Click the browse button to the right of the expression box.

For example, on the Contact table in SalesLogix the expressions are:

- Primary key - #ContactID - the unique record identifier for the Contact table
- Foreign key - #AccountID - identifies the parent record in the Account table

### Matching

For matching, you must specify an expression on the source record and an expression on the target record. Each expression is evaluated, and for a match to occur the results must be equal.