Once again @pmario posted faster than me! Here is my take at it anyway:
The official jsonset documentation has numerous examples, and you can use them like this:
- use a
let
widget to store the result of your jsonset
filter in a variable
- define an action procedure with one or some
$action-setfield
widgets
- use the variable and the procedure in a
$button
widget
Here is a simple example to add “d” property with “jaguar” value to a json object:
\procedure myActions()
<$action-setfield $tiddler="myTiddler" $field="text" $value=<<myValue>>/>
\end
<!-- insert whatever wikitext you want here -->
<$let
object-a="""{
"a": "one",
"b": "",
"c": "three"
}"""
myValue={{{ [<object-a>jsonset[d],[Jaguar]] }}}
>
<$button actions=<<myActions>>>Try!</$button>
</$let>
To view the result, click on the button and open the new “myTiddler” tiddler.
Remember the procedure should be defined at the very beginning of the tiddler or it won’t work.
Hope this helps,
Fred