Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
JSON.IsValid
Checks if JSON text is valid.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JSON | 6.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "JSON.IsValid"; JSON ) More
Parameters
Parameter | Description | Example |
---|---|---|
JSON | The JSON text to parse. | "[1,2,3]" |
Result
Returns 1, 0 or error.
Description
Checks if JSON text is valid.This parses the JSON text and returns 1 on success or 0 on failure.
This checks if the given text is a valid JSON fragment and can be e.g. added as value to a JSON object or array. So this returns 1 for proper formatted boolean, number and text pieces, too.
Examples
Checks validity:
MBS( "JSON.IsValid"; "[1,2,3]" )
Example result: 1
Checks with error:
MBS( "JSON.IsValid"; "[1,hello,3]" )
Example result: 0
Check number:
MBS("JSON.IsValid"; 123)
Example result: 1
See also
Release notes
- Version 14.3
- Reimplemented JSON.IsValid using newer JSON functions internally, so it catches more errors.
- Version 12.5
- Fixed a problem with JSON.IsValid accepting garbage characters behind parsing.
Blog Entries
- MBS FileMaker Plugin, version 14.3pr5
- MBS FileMaker Plugin, version 12.5pr4
- With JSON in excellent form
- MBS FileMaker Plugin, version 6.3pr4
FileMaker Magazin
This function is free to use.
Created 23th June 2016, last changed 25th June 2024