JSON.CreateValue
----------------

Creates a new value.

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

MBS( "JSON.CreateValue"; Value ) 

**MBS**( **"JSON.CreateValue";** /\* Creates a new value. \*/  
**$Value**) /\* The value to pass.  
Can be number, date, time, timestamp or text.e.g. "Hello" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Value | The value to pass.   Can be number, date, time, timestamp or text. | "Hello" |

### Result

Returns JSON or error.

### Description

Creates a new value.  
Convenience function to either create text or number depending on FileMaker data type.  
### Examples

Create with number:

 MBS ( "JSON.CreateValue"; 123 )  
<small>  
Example result: 123</small>Create with string:

 MBS ( "JSON.CreateValue"; "Hello" &amp; ¶ &amp; "World" &amp; char(9) &amp; "test" )  
<small>  
Example result: "Hello\\rWorld\\ttest"</small>### See also

- [JS.CallFunctionValues](JSCallFunctionValues.md)
- [JSON.AddItemToObject](JSONAddItemToObject.md)
- [JSON.CreateFalse](JSONCreateFalse.md)
- [JSON.CreateNull](JSONCreateNull.md)
- [JSON.CreateObjectRef](JSONCreateObjectRef.md)
- [JSON.CreateTrue](JSONCreateTrue.md)

### Release notes

- **Version 9.0**
    - Added [JSON.CreateValue](http://www.mbsplugins.eu/JSONCreateValue.shtml), [JSON.Equals](http://www.mbsplugins.eu/JSONEquals.shtml), [JSON.FindValueInArray](http://www.mbsplugins.eu/JSONFindValueInArray.shtml) and [JSON.FindValueInObjectArray](http://www.mbsplugins.eu/JSONFindValueInObjectArray.shtml) functions.

### Example Databases

- [JavaScript/FM JSON Path](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/JavaScript/FM%20JSON%20Path.shtml#1ScriptAnchor_)

### Blog Entries

- [FileMaker and MongoDB](https://www.mbsplugins.de/archive/2023-03-20/FileMaker_and_MongoDB/monkeybreadsoftware_blog_filemaker)
- [Fun with While function in FileMaker](https://www.mbsplugins.de/archive/2019-07-22/Fun_with_While_function_in_Fil/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.6pr4](https://www.mbsplugins.de/archive/2018-12-18/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 14th December 2018 , last changed 14th December 2018

  
[JSON.CreateTrue](JSONCreateTrue.md) - [JSON.CurrentMatch](JSONCurrentMatch.md)

[HTML Version](JSONCreateValue.shtml)