Json Manager (Construct 3 Plugins)

You're viewing a single comment in a conversation. View all the comments
  • 8 Comments

  • Order by
  • No Problem

    I also updated the example project to include this new functionality if you need to look at it.

    • Looks like i have trouble to get it to work. I downloaded the new sample, but couldn't see in it an example of loading from string.

      Could you perhaps past some instructions here or create a sample dedicated for loading from string -- if possible.

      Essentially, i create a new slot in the UI "s1", i then in the event action that follows the ajax on complete, i loaded into s1 the ajax.lastdata ... i then wanted to see in the debug window that the json manager includes the data, but its empty.

      thank you,

      Dan

      • I'm away from my computer now for a bit. The example should have a load from string button. You don't have to specify the slot in the ui. The load string will create the slot. I haven't hooked up any out put to the debug window yet. The easiest way is to use the browser alert and use the json manager to get a value

        You don't have to use the original load method if you are using the string one.

        • Hi,

          I got it to work! (and noticed the loadstring in the example).

          I got one problem left, though -- probably related to the json format google sheet returns:

          It looks like this:

          In trying to get the values into a dictionary or array, i am getting lots of brackets like: [[["str1"]]]

          and when trying to loop over things its not clear to me what the query expression is after "values", to get at individual strings.

          The objective is to get all of them into a listbox.

          any thoughts are much appreciated.

          Dan

          {

          "range": "Sheet1!A4:A7",

          "majorDimension": "ROWS",

          "values": [ [ "str1" ],

          [ "str2" ],

          [ "str3" ]

          ]

          }

          • Here is an example when i use array.asJson:

            {"c2array":true,"size":[22,1,1],"data":[[[["str1"]]],[[["str2"]]],[[["str3"]]]]]]}

            • Was this generated from the JsonManager. What might be easier if you have a sample project I can look at to see if I can help

              • Thank you.

                Yes, its basically the to array function applied to JsonManager and then the array is displayed as json.

                I will put together a sample project.

                Is there a way i can send it to you?