Utilities

JSON

Create a JSON string (encode)

Converts and returns an object or array as a JSON string

 

{ }
[{"data":{"type":"variable","step":"dict\/object","var":"obj","val":{"list\/array":[1,"2",false],"string":"helloworld","int":10,"bool":true,"number":10.42},"maxpaths":1,"uuid":"d7db099a1a3f9e2df693cd4422bb26cb","x":300,"y":320,"width":120,"height":32},"paths":["9148d39266042bc89aff74e46b1a483b"]},{"data":{"type":"library","step":"encode to JSON","call":"utilities.json.encode","args":{"value":"{\"~\":\"obj\"}"},"maxpaths":1,"uuid":"9148d39266042bc89aff74e46b1a483b","x":300,"y":400,"width":120,"height":32,"utilities":"utilities","utilities.json.encode":"encode","data_to_var":"result"},"paths":[]}]

Example Response

{"result":"{\"list\/array\": [1, \"2\", false], \"int\": 10, \"bool\": true, \"string\": \"helloworld\", \"number\": 10.42}"}

Get an object from a JSON string (decode)

Converts and returns an object or array from a JSON string

 

{ }
[{"data":{"type":"variable","step":"JSON string","var":"obj","val":"{\"list\/array\": [1, \"2\", false], \"int\": 10, \"bool\": true, \"string\": \"helloworld\", \"number\": 10.42}","maxpaths":1,"uuid":"d7db099a1a3f9e2df693cd4422bb26cb","x":300,"y":320,"width":120,"height":32},"paths":["9148d39266042bc89aff74e46b1a483b"]},{"data":{"type":"library","step":"decode from JSON","call":"utilities.json.decode","args":{"value":"{\"~\":\"obj\"}"},"maxpaths":1,"uuid":"9148d39266042bc89aff74e46b1a483b","x":300,"y":400,"width":120,"height":32,"utilities":"utilities","utilities.json.decode":"decode","data_to_var":"result"},"paths":[]}]

Example Response

{"result":{"list\/array":[1,"2",false],"string":"helloworld","int":10,"bool":true,"number":10.42}}