JSON.InsertRecords
------------------

Inserts multiple records in a table in one line using JSON.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [JSON](component_JSON.md) | [14.5](newinversion145.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "JSON.InsertRecords"; FileName; TableName; JSON ) 

**MBS**( **"JSON.InsertRecords";** /\* Inserts multiple records in a table in one line using JSON. \*/  
**$FileName**; /\* The file name of where the table is inside. Can be empty to look for the table in all files.  
  
Using a table in another database file may require you adding the other file as an external data source and adding the external table to your relationship graph to grant access.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" \*/   
**$JSON**) /\* The JSON arrays with the records. \*/ 

### 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.      Using a table in another database file may require you adding the other file as an external data source and adding the external table to your relationship graph to grant access. | 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" |
| JSON | The JSON arrays with the records. |  |

### Result

Returns OK or error.

### Description

Inserts multiple records in a table in one line using JSON.  
Like [JSON.InsertRecord](JSONInsertRecord.md), but takes a JSON array.  
### Examples

Add two records in one call:

 MBS ("JSON.InsertRecords"; ""; "Contacts"; "\[{\\"FirstName\\": \\"John\\", \\"TheNumber\\": 123}, {\\"FirstName\\": \\"Thom\\", \\"TheNumber\\": 234}\]")  
### See also

- [FM.InsertRecord](FMInsertRecord.md)
- [FM.SQL.InsertRecords](FMSQLInsertRecords.md)
- [JSON.DeleteRecords](JSONDeleteRecords.md)
- [JSON.InsertRecord](JSONInsertRecord.md)
- [SchemaChange.Changes](SchemaChangeChanges.md)
- [SQL.InsertRecords](SQLInsertRecords.md)
- [XML.InsertRecords](XMLInsertRecords.md)

### Release notes

- **Version 14.5**
    - Added [JSON.InsertRecords](https://www.mbsplugins.eu/JSONInsertRecords.shtml) function to insert array of records in JSON.

### Example Databases

- [SchemaChanges/SchemaChanges](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SchemaChanges/SchemaChanges.shtml#3ScriptAnchor_)

### Blog Entries

- [Watching for schema changes in your FileMaker Server](https://www.mbsplugins.de/archive/2025-11-19/Watching_for_schema_changes_in/monkeybreadsoftware_blog_filemaker)
- [New in MBS FileMaker Plugin in Version 14.5](https://www.mbsplugins.de/archive/2025-01-08/New_in_MBS_FileMaker_Plugin_in/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.5pr1](https://www.mbsplugins.de/archive/2024-10-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 19th September 2024 , last changed 19th September 2024

  
[JSON.InsertRecord](JSONInsertRecord.md) - [JSON.IsValid](JSONIsValid.md)

[HTML Version](JSONInsertRecords.shtml)