Instructions
JSON Machine Pro
See demo page
getjson.bubbleapps.io/pro
Part 1 - Install
Local
1) Place Read/Write (Local) page element on the page.
2) Give it a unique name in the 'name' field
3) Specify the 'read/write (local)' action
4) Each datatype (text, number, yes/no, date) has its own group of key/value pairs which you can specifyonfigure with multiple JSON keys/ values. Keys will be used for both reading and writing.
4) IMPORTANT *Fill out the same 'name' of the JSON machine (bulk) page element from step 2 . The output data from this action will be directed to that page element.
Server
1) Place in a workflow
2) Use the read/write (server) action and configure with your input JSON multiple JSON values.
3) IMPORTANT *Fill out the name of the page element in the action so the output data from the action will be directed there.
4) When read action is selected output is arrays of typed data. When write action is selected output is JSON.
You can target nested data using dot notation ie. customer.name.first
Part 2 - Working with JSON output or read-in values
Where to look:
Local
To get your read-in values or your written-out JSON look at the element that was placed on the page in step 1.
Server
In subsequent steps, "Result of step x
For read-in values
Just like there typed key/value inputs in your workflow step for text,number,yes/no, dates, there are separate lists outputs for each type of data. Item #1 corresponds to the first key/value for that type, item #2 with the 2nd key/value for that type and so on.
For output JSON
There is an output called "Write JSON: Output"
=======================
Standard JSON Machine
This plugin has 2 page elements.
'read JSON' and 'modify JSON'.
When you want to read data, or display it, or work with in on the page use the 'read JSON' element. You place one unique element on the page for each piece of data you want to work with. For nested lists/arrays see example app.
When you want to modify JSON text for saving, etc. You place one or more elements on the page and trigger the modify workflow
Each element has two input fields 'input JSON' and 'key'.
input JSON
The json data you want to read from or modify
Key
Location in the JSON you wish to read from or write to. Read documentation see example app for more info
The JSON read element
has many different outputs each associated with (a) different data type and (b) if it is a list value or not. This allows you to connect many different elements and expressions to properly match the output of the read element. **The output is automatically determined by the JSON parser based on the formatting of your JSON This behavior cannot be changed at present.**. You should know what data type to be expecting. JSON Dates, for example, are stored as strings and read as strings with the plugin.