JSON.Compact
------------

Returns compact unformatted JSON for the given JSON text.

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

MBS( "JSON.Compact"; JSON ) 

**MBS**( **"JSON.Compact";** /\* Returns compact unformatted JSON for the given JSON text. \*/  
**$JSON**) /\* A JSON text or reference.e.g. "\[1,2,3\]" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| JSON | A JSON text or reference. | "\[1,2,3\]" |

### Result

Returns JSON code.

### Description

Returns compact unformatted JSON for the given JSON text.  
### Examples

Creates compact text of JSON with spaces:

 MBS ( "JSON.Compact"; "\[1, 3, 4\]" )  
<small>  
Example result:   
\[1 ,3 ,4 \] </small>Compacts JSON and removes spaces:

 MBS ( "JSON.Compact"; "\[1 , 2 , 3\]" )  
<small>  
Example result:   
\[1 ,2 ,3 \] </small>### See also

- [IBAN.Compact](IBANCompact.md)
- [JSON.CreateArrayRef](JSONCreateArrayRef.md)
- [JSON.Format](JSONFormat.md)

### Example Databases

- [Text functions/Text functions](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Text%20functions.shtml#3ScriptAnchor_)
- [Text functions/Text Styles](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Text%20Styles.shtml#2ScriptAnchor_)

### Blog Entries

- [With JSON in excellent form](https://www.mbsplugins.de/archive/2019-11-16/With_JSON_in_excellent_form/monkeybreadsoftware_blog_filemaker)
- [JSON with large integers](https://www.mbsplugins.de/archive/2018-05-11/JSON_with_large_integers/monkeybreadsoftware_blog_filemaker)
- [Generate JSON with MBS Plugin](https://www.mbsplugins.de/archive/2013-12-03/Generate_JSON_with_MBS_Plugin/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2020, Seite 16](https://filemaker-magazin.de/neuigkeit/4110-Appetithappen-FMM_202005)

This function is free to use.

Created 18th August 2014 , last changed 11st December 2016

  
[JSON.Colorize](JSONColorize.md) - [JSON.CreateArray](JSONCreateArray.md)

[HTML Version](JSONCompact.shtml)