Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
JSON.Colorize
Formats a JSON string with color.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JSON | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
(old name: JSON.Colourise)
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
json | A JSON text. | {"key":"value"} | |
DarkMode | Available in MBS FileMaker Plugin 12.1 or newer. Whether to swap colors to use white for text color. Pass 1 for dark mode and 0 for light mode. Default is 0 for light mode. |
0 | Optional |
Result
Returns formatted text or error.
Description
Formats a JSON string with color.This colorizes an existing JSON text to show to user, but does not check syntax.
Keys get blue, text value purple, numbers and others orange and brackets black.
Text is returned only with colors. You can apply text font and font size with normal FileMaker functions.
Processing time is linear to length, so should be faster than custom functions.
Examples
Colorize a field:
Set Field [ Data::JSON ; MBS("JSON.Colorize"; Data::JSON) ]
Colorize in Auto-Enter calculation:
MBS("JSON.Colorize"; self)
// put this calculation into a field, so the field gets colorized whenever the field is changed and the record gets commited.
Colorize leaves escapes in place:
MBS("JSON.Colorize"; "[\"Test\",\"🍎\",\"Escaped \uD83C\uDF4E\"]")
Example result:
["Test","🍎","Escaped \uD83C\uDF4E"]
See also
- CURL.GetResultAsEMailList
- CURL.SetOptionURL
- DynaPDF.GetDocInfoAsJSON
- DynaPDF.GetFieldsAsJSON
- Files.AudioTags
- JSON.CreateArrayRef
- JSON.CreateObjectRef
- SharingService.ServicesForItems
- Text.AddLineNumbers
- WebRequest.GetHeaders
Release notes
- Version 12.5
- Fixed JSON.Colorize to work better with color for keys in nested objects.
- Version 12.3
- You can now use english spelling JSON.Colourise and XML.Colourise if you prefer to call JSON.Colorize or XML.Colorize.
- Version 12.1
- Added darkMode parameter for XML.Colorize and JSON.Colorize function.
- Version 11.5
- Fixed a problem in JSON.Colorize function with coloring arrays.
- Version 8.2
- Added JSON.Colorize and JSON.ToHTML functions.
Example Databases
- CURL/Email/IMAP Email
- CURL/FTP/CURL FTP Directory Listing
- Files/Audio File Tags
- JSON/JSON Colorized
- JSON/JSON Import
- JSON/JSON to HTML
- Network/Bonjour
- WebHook/WebHook
- Win Only/Windows Location
- XML/XML to JSON
Blog Entries
- MBS FileMaker Plugin, version 12.5pr4
- MBS FileMaker Plugin, version 12.3pr1
- MBS FileMaker Plugin 12.1 - More than 6700 Functions In One Plugin
- MBS FileMaker Plugin, version 12.1pr1
- XML and JSON Colorize for Dark Mode
- FileMaker Developers in Southern California
- With JSON in excellent form
- MBS FileMaker Plugin 8.3 released
- Colorize JSON or XML in FileMaker with line numbers
- Colorize JSON in FileMaker
FileMaker Magazin
This function is free to use.
Created 6th April 2018, last changed 31st January 2023
