Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
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)
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 |
Returns formatted text or error.
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"]
This function is free to use.
Created 6th April 2018, last changed 31st January 2023