This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
token:JSONValue [2019/06/24 05:01] peternlewis [Example] |
token:JSONValue [2019/06/24 23:33] peternlewis |
||
---|---|---|---|
Line 13: | Line 13: | ||
Strict mode affects how the result will be returned. In Strict mode, the result will be a strict JSON objects - strings will be double quoted and appropriately escaped. In Non-Strict mode, string results will be returned as the decoded and de-quoted string. Other types of results will be the same regardless of the Strict mode (containers are always be strictly JSON objects) (See the [[manual:JSON]] user manual section). | Strict mode affects how the result will be returned. In Strict mode, the result will be a strict JSON objects - strings will be double quoted and appropriately escaped. In Non-Strict mode, string results will be returned as the decoded and de-quoted string. Other types of results will be the same regardless of the Strict mode (containers are always be strictly JSON objects) (See the [[manual:JSON]] user manual section). | ||
- | ===== Example ===== | + | ===== Examples ===== |
If a Keyboard Maestro variable `J` contains the JSON object: | If a Keyboard Maestro variable `J` contains the JSON object: | ||
Line 30: | Line 30: | ||
| `%JSONValue%J.d[2]%` | `two` | (Compact/Pretty variant has no affect) | | | `%JSONValue%J.d[2]%` | `two` | (Compact/Pretty variant has no affect) | | ||
| `%JSONValueStrict%J.d[2]%` | `"two"` | (Compact/Pretty variant has no affect) | | | `%JSONValueStrict%J.d[2]%` | `"two"` | (Compact/Pretty variant has no affect) | | ||
- | | `%JSONValueStrict%J.d[0]%` | `3` | (Variants have no affect) | | + | | `%JSONValue%J.d[0]%` | `3` | (Variants have no affect) | |
+ | | `%JSONValue%J.d[-2]%` | `two` | (the second last entry) | | ||
+ | | `%JSONValue%J.d[COUNT()]%` | `3` | (the last entry) | | ||
The exact format of the white space in the Pretty format should not be assumed, it might be any number of spaces or tabs. | The exact format of the white space in the Pretty format should not be assumed, it might be any number of spaces or tabs. | ||
Line 47: | Line 49: | ||
=== Functions === | === Functions === | ||
- | * [[function:DAY|DAY()]] | + | * [[function:JSONVALUE | JSONVALUE(jsonpath)]] |
* [[:Functions|See all Functions]] | * [[:Functions|See all Functions]] | ||
Line 54: | Line 56: | ||
* [[token:JSONFromDictionary | JSONFromDictionary]] | * [[token:JSONFromDictionary | JSONFromDictionary]] | ||
* [[token:JSONFromVariables | JSONFromVariables]] | * [[token:JSONFromVariables | JSONFromVariables]] | ||
- | * [[token:JSONValue | JSONValue]] | ||
* [[:Tokens|See all Tokens]] | * [[:Tokens|See all Tokens]] | ||
+ | |||
+ | === Collections === | ||
+ | |||
+ | * [[collection:JSON_Keys | JSON Keys]] | ||
+ | * [[:Collections |See all Tokens]] | ||
+ |