FM.InsertOrUpdateRecord5
------------------------

Inserts or updates a record in a table in one line.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [FM](component_FM.md) [FMSQL](component_FMSQL.md) | [11.2](newinversion112.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "FM.InsertOrUpdateRecord5"; FileName; TableName; IDField1; IDValue1; IDField2; IDValue2; IDField3; IDValue3; IDField4; IDValue4; IDField5; IDValue5; FieldName...; FieldValue... ) 

**MBS**( **"FM.InsertOrUpdateRecord5";** /\* Inserts or updates a record in a table in one line. \*/  
**$FileName**; /\* The file name of where the table is inside. Can be empty to look for the table in all files.e.g. Get(FileName) \*/   
**$TableName**; /\* The name of the table to insert record into.  
Can be ID of table, so we lookup name by ID.   
Can be result of GetFieldName() function as we remove field name automatically.e.g. "Assets" \*/   
**$IDField1**; /\* The name of the field which provides an unique ID for each record, so we can identify the field.  
Can be ID of field, so we lookup name by ID.   
Can be result of GetFieldName() function as we remove table name automatically.e.g. "ID1" \*/   
**$IDValue1**; /\* The value for the ID field to identify the record.  
Data type of parameter must match the data type of the field.e.g. $RecordID \*/   
**$IDField2**; /\* The name of the field which provides an unique ID for each record, so we can identify the field.  
Can be ID of field, so we lookup name by ID.   
Can be result of GetFieldName() function as we remove table name automatically.e.g. "ID2" \*/   
**$IDValue2**; /\* The value for the ID field to identify the record.  
Data type of parameter must match the data type of the field.e.g. $RelatedRecordID \*/   
**$IDField3**; /\* The name of the field which provides an unique ID for each record, so we can identify the field.  
Can be ID of field, so we lookup name by ID.   
Can be result of GetFieldName() function as we remove table name automatically.e.g. "ID3" \*/   
**$IDValue3**; /\* The value for the ID field to identify the record.  
Data type of parameter must match the data type of the field.e.g. $OtherRecordID \*/   
**$IDField4**; /\* The name of the field which provides an unique ID for each record, so we can identify the field.  
Can be ID of field, so we lookup name by ID.   
Can be result of GetFieldName() function as we remove table name automatically.e.g. "ID4" \*/   
**$IDValue4**; /\* The value for the ID field to identify the record.  
Data type of parameter must match the data type of the field.e.g. $ForthRecordID \*/   
**$IDField5**; /\* The name of the field which provides an unique ID for each record, so we can identify the field.  
Can be ID of field, so we lookup name by ID.   
Can be result of GetFieldName() function as we remove table name automatically.e.g. "ID5" \*/   
**$IDValue5**; /\* The value for the ID field to identify the record.  
Data type of parameter must match the data type of the field.e.g. $FifthRecordID \*/   
**$FieldName...**; /\* A field name to set.e.g. "Model" \*/   
**$FieldValue...**) /\* A field value to use for setting the field in the parameter before.  
Data type of parameter must match the data type of the field.e.g. "Test" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| FileName | The file name of where the table is inside. Can be empty to look for the table in all files. | Get(FileName) |
| TableName | The name of the table to insert record into.   Can be ID of table, so we lookup name by ID.    Can be result of GetFieldName() function as we remove field name automatically. | "Assets" |
| IDField1 | The name of the field which provides an unique ID for each record, so we can identify the field.   Can be ID of field, so we lookup name by ID.    Can be result of GetFieldName() function as we remove table name automatically. | "ID1" |
| IDValue1 | The value for the ID field to identify the record.   Data type of parameter must match the data type of the field. | $RecordID |
| IDField2 | The name of the field which provides an unique ID for each record, so we can identify the field.   Can be ID of field, so we lookup name by ID.    Can be result of GetFieldName() function as we remove table name automatically. | "ID2" |
| IDValue2 | The value for the ID field to identify the record.   Data type of parameter must match the data type of the field. | $RelatedRecordID |
| IDField3 | The name of the field which provides an unique ID for each record, so we can identify the field.   Can be ID of field, so we lookup name by ID.    Can be result of GetFieldName() function as we remove table name automatically. | "ID3" |
| IDValue3 | The value for the ID field to identify the record.   Data type of parameter must match the data type of the field. | $OtherRecordID |
| IDField4 | The name of the field which provides an unique ID for each record, so we can identify the field.   Can be ID of field, so we lookup name by ID.    Can be result of GetFieldName() function as we remove table name automatically. | "ID4" |
| IDValue4 | The value for the ID field to identify the record.   Data type of parameter must match the data type of the field. | $ForthRecordID |
| IDField5 | The name of the field which provides an unique ID for each record, so we can identify the field.   Can be ID of field, so we lookup name by ID.    Can be result of GetFieldName() function as we remove table name automatically. | "ID5" |
| IDValue5 | The value for the ID field to identify the record.   Data type of parameter must match the data type of the field. | $FifthRecordID |
| FieldName... | A field name to set. | "Model" |
| FieldValue... | A field value to use for setting the field in the parameter before.   Data type of parameter must match the data type of the field. | "Test" |

### Result

Returns OK or error.

### Description

Inserts or updates a record in a table in one line.  
Same as [FM.InsertOrUpdateRecord](FMInsertOrUpdateRecord.md), but with 5 ID fields to locate record.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat FieldName and FieldValue parameters as often as you need.  
### Examples

Update record with 5 identifying fields:

 MBS ( "FM.InsertOrUpdateRecord5";   
""; "Contacts";   
  
// 5 fields to identify record  
"First"; "Christian";   
"Last"; "Schmitz";   
"Company"; "MBS ";   
"Title"; "Mr";   
"Group"; "MBS ";   
  
// one field to set  
"Fax"; "122345" )  
### See also

- [FM.InsertOrUpdateRecord](FMInsertOrUpdateRecord.md)
- [FM.InsertOrUpdateRecord2](FMInsertOrUpdateRecord2.md)
- [FM.InsertOrUpdateRecord3](FMInsertOrUpdateRecord3.md)
- [FM.InsertOrUpdateRecord4](FMInsertOrUpdateRecord4.md)
- [FM.InsertOrUpdateRecordQuery](FMInsertOrUpdateRecordQuery.md)
- [FM.SQL.InsertOrUpdateRecords](FMSQLInsertOrUpdateRecords.md)
- [JSON.InsertOrUpdateRecord](JSONInsertOrUpdateRecord.md)
- [Matrix.InsertOrUpdateRecords](MatrixInsertOrUpdateRecords.md)
- [SQL.InsertOrUpdateRecords](SQLInsertOrUpdateRecords.md)

### Release notes

- **Version 11.2**
    - Added [FM.InsertOrUpdateRecord4](https://www.mbsplugins.eu/FMInsertOrUpdateRecord4.shtml) and [FM.InsertOrUpdateRecord5](https://www.mbsplugins.eu/FMInsertOrUpdateRecord5.shtml).

### Blog Entries

- [MBS FileMaker Advent calendar - Door 24 - Insert or Update](https://www.mbsplugins.de/archive/2025-12-24/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [Insert or update with JSON](https://www.mbsplugins.de/archive/2024-08-28/Insert_or_update_with_JSON/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin 11.2](https://www.mbsplugins.de/archive/2021-05-26/New_in_MBS_FileMaker_Plugin_11/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.2pr1](https://www.mbsplugins.de/archive/2021-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 9th March 2021 , last changed 5th June 2021

  
[FM.InsertOrUpdateRecord4](FMInsertOrUpdateRecord4.md) - [FM.InsertOrUpdateRecordQuery](FMInsertOrUpdateRecordQuery.md)

[HTML Version](FMInsertOrUpdateRecord5.shtml)