3 Replies Latest reply on Dec 19, 2016 11:53 PM by jens.bruckmann

    in the output of json file is a blank

    jens.bruckmann

      Hi all I was able to get my json file working (nearly)

       

      I am now facing another issue. When I run my link in Chrome I see as a column name

       

      Available Memory

       

      when I now try to run

       

      "Available Memory": feat[j].Available Memory,

       

      it is not working as there is a blank in.

       

      I already tried to use a "_" but this did not help

       

      Any Idea?

        • 1. Re: in the output of json file is a blank
          jens.bruckmann

          hi,

          I try it to make it more clear. The output of the json file looks like this:

           

          {"datetime":"14.12.2016 14:03:13","Percent Available Memory":53.6580,"Available_Memory":3366584320.0000,"Total Memory":6274154496.0000,"coverage":"100 %"},{"datetime":"14.12.2016 14:08:13","Percent Available Memory":53.2934,"Available_Memory":3343712256.0000,"Total Memory":6274154496.0000,"coverage":"100 %"}

           

          The issue what I am facing now is the column names have a blank in which I am not able to read. It must be the blank as I tried to rename one sensor from “Available Memory” to “Available_Memory” and then I got a value. So the question now is how to get the blank in the word inserted into the script as the ID does not allow a blank in.

           

          Here is the part of the script I am talking about:

           

            for ( var j = 0, len = feat.length; j < len; j++)

            {

                          tableData.push({

            "id" : id_temp,

                              "datetime": feat[j].datetime,

            "Percent_Available_Memory": feat[j].Percent_Available_Memory,

                              "Available_Memory": feat[j].Available_Memory,

            //"value2": feat[j].value,

                              //"value_raw2": feat[j].value_raw,

            //"value3": feat[j].value,

                              //"value_raw3": feat[j].value_raw,

            "coverage": feat[j].coverage,

            "coverage_raw": feat[j].coverage_raw

                          });

                      }

          }});

          • 2. Re: in the output of json file is a blank
            Glen Robinson

            Hi Jens,

            Please try the following line instead.

            "Percent_Available_Memory": feat[j]["Percent Available Memory"],

             

            All the best

            Glen

             

            • 3. Re: in the output of json file is a blank
              jens.bruckmann

              Thanks a lot Glen. (Again )

               

              This makes perfect sense