JSON.SetFormatOptions
---------------------

Sets options for formatting JSON.

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

MBS( "JSON.SetFormatOptions" { ; tabIndention; tabAfterObjectKey } ) 

**MBS**( **"JSON.SetFormatOptions";** /\* Sets options for formatting JSON. \*/  
**$tabIndention**; /\* Optional; What to use for indention.  
e.g. Char(9) for tabs, Char(32) for spaces.e.g. " " \*/   
**$tabAfterObjectKey**) /\* Optional; What to use for space between the double colon and the value in an object.  
By default this is a space character.e.g. " " \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| tabIndention | What to use for indention.   e.g. Char(9) for tabs, Char(32) for spaces. | " " | Optional |
| tabAfterObjectKey | What to use for space between the double colon and the value in an object.   By default this is a space character. | " " | Optional |

### Result

Returns OK or error.

### Description

Sets options for formatting JSON.  
If called without parameters, it will reset to default, Char(9) for indention and a space before object values.  
For use in the [JSON.Format](JSONFormat.md) function.  
### Examples

Try variants:

 Let(  
 \[  
 json = "{\\"test\\":1234, \\"values\\":\[2,3,4\]}";  
// default settings  
 format1 = MBS ( "[JSON.Format](JSONFormat.md)"; json );  
// use minus and plus, so you see it:  
 r = MBS ( "JSON.SetFormatOptions"; "-"; "+" );  
 format2 = MBS ( "[JSON.Format](JSONFormat.md)"; json );  
// no tabs  
 r = MBS ( "JSON.SetFormatOptions"; ""; "" );  
 format3 = MBS ( "[JSON.Format](JSONFormat.md)"; json );  
// reset to default settings  
 r = MBS ( "JSON.SetFormatOptions" )  
 \];  
 format1 &amp; ¶ &amp; format2 &amp; ¶ &amp; format3  
)  
<small>  
Example result:   
{ "test" : 1234 , "values" : \[2 , 3 , 4 \] } { -"test" :+1234 , -"values" :+\[2 , 3 , 4 \] } { "test" :1234 , "values" :\[2 , 3 , 4 \] } </small>### See also

- [JSON.Format](JSONFormat.md)

### Release notes

- **Version 16.0**
    - Added [JSON.SetFormatOptions](https://www.mbsplugins.eu/JSONSetFormatOptions.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin 16.0 News](https://www.mbsplugins.de/archive/2026-01-20/MBS_FileMaker_Plugin_160_News/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.6pr3](https://www.mbsplugins.de/archive/2025-12-15/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 12nd December 2025 , last changed 12nd December 2025

  
[JSON.Search](JSONSearch.md) - [JSON.SetPathItem](JSONSetPathItem.md)

[HTML Version](JSONSetFormatOptions.shtml)