$tc(JSON, gv(GLOBAL), .path)$ = Error

Basic Info:

klwp v3.82 3.82b602519beta

android 16 oneui 8

When storing raw JSON format in the global and calling it with $tc(JSON)$… the output is getting wrong formatted… resulting in errors like `tc: net.minidev.json.parser.j: unexpected end of file position 630: null`

Weirdly it behaves the same after a downgrade to version 3.81b531008

##KUSTOMCLIP##
{
  "clip_version": 1,
  "KUSTOM_GLOBAL": {
    "json": {
      "index": 0,
      "type": "TEXT",
      "title": "json",
      "value": "{\npath:{path2:\"result\"}\n}",
      "key": "json"
    },
    "palette": {
      "index": 0,
      "type": "TEXT",
      "title": "palette",
      "value": "$tc(json, gv(json), \".path\")$",
      "key": "palette"
    }
  }
}
##KUSTOMCLIP##

This results in `{path2=result}`

It looks like your JSON is breaking around character 630 because you’re trying to store a large raw string inside a Text Global. Kustom globals have size limits, so the data gets truncated, which causes the unexpected end of file error.

The better approach is to use the wg function and read your JSON directly from a file. It’s far more stable and bypasses all global‑variable limitations.

Move your JSON into a local file (e.g., sdcard/Kustom/theme.json).

Then use this formula to access your colors/data:

$wg(“file:///sdcard/Kustom/theme.json”, json, “.your.path.here”)$

If you need multiple colors from that JSON for different UI elements, just create separate Color Globals and put a specific wg formula in each one (for example, one for .day.bg, another for .day.text). Kustom caches the file, so this method is fast, clean, and avoids the complexity of trying to manage everything through Flow.

That’s news to me, do you perhaps know what the limit is?

I don’t know the exact character limit, but for the sake of science, I tried stress-testing a Text Global. After pasting several thousands of characters multiple times, I eventually hit an App Not Responding (ANR) error.

My point wasn’t about the exact number, but about stability. I suggested the local file method because it’s the most reliable way to handle large data without making the editor laggy or risking truncated strings. Just trying to help the user avoid those headache-inducing 'Unexpected end of file errors.

I think its more the wrong output you get… if you read the json strings get converted into

Name=Value…

And reading forward from that point on fails.