I’m struggling to work out how to save an HTTP GET results into an array/object using Storage.
I have button where I do an HTTP GET to download a JSON feed. This retrieves a JSON feed - an array of 250 objects, each with 4 fields.
Currently I do the following, which works, however I don’t save to storage. I want to replace this methodology to use Storage instead:
- create App Variable “MyVar” → “list of objects with N properties”.
FLOW:
- Button tap
- SetAppVariable = [ ] (empty the var)
- DATA HTTPGET (url)
- SetAppVariable =
VariableName:“MyVar”,
AssignedValue: Formula:“outputs[“HTTPGET”].resBodyParsed”
I then use this MyVar local variable do do some things later on, with a different button press, iterating records correctly in JS, etc
However, how would I get this into storage instead?
I’ve tried the following, but it doesn’t work
GlobalCanvas:
- Event → “App Launched” → “Get Item From Storage”: key:“allmyvars”
- SetAppVariable, VariableName:“MyVar”, AssignedValue: output from previous? formula:
inputs[“Get item from storage”].item?
and
- Event → “App Variable ‘MyVar’ changed”
- → Storage: Set Item to storage: “key”:‘allmyvars’, “Data To Store”: Output another node: Receive Event: Event Object
Many thanks,
J