Skip to first unread message
Assigned to aget...@gmail.com by taifu...@gmail.com

Sunny Afternoons

unread,
Jun 8, 2016, 1:26:29 PM6/8/16
to MIT App Inventor Forum
It is possible add, edit or delete nodes in a json file with web component?

Thanks.

Abraham Getzler

unread,
Jun 8, 2016, 2:21:49 PM6/8/16
to MIT App Inventor Forum
While there is a Web component block to decode a JSON string into a tree of name-value pairs, there is no native block support to reverse this.
I've attached a rudimentary blocks routine to make a JSON string out of a pair list, and sample calls.

Look into the  experimental FireBase component if you want to live in a persistent JSON tree.

I have an incomplete Rock Paper Scissors sample I started if you want a head start on FireBase.

See the end of this page for how to navigate a tree in AI2 ...



ABG

JSON_pairs_to_text.jpg
JSON_XYZ_encoding.jpg
pairs_to_JSON_to_pairs_to_lookup_value.jpg
JSON_encode_pairs.aia

Abraham Getzler

unread,
Jun 8, 2016, 3:22:05 PM6/8/16
to MIT App Inventor Forum

Sunny Afternoons

unread,
Jun 10, 2016, 7:29:34 AM6/10/16
to MIT App Inventor Forum
Thanks.
Reply all
Reply to author
Forward
0 new messages