• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Bulk editing point definitions.

    How-To
    2
    6
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Phillip Weeks
      last edited by

      I was wondering if there was a simple way to get a JSON file of all the points with the same name across a group of datasources. We have 100 data sources that use the same nomenclature and I just want to pluck out one point for all the data sources and do a bulk edit on its point property template field. I can make a watchlist but how do I get a JSON file of the point definitions. Is this even possible. I could take all the JSON for all the points and filter out the relevant stuff in an editor but I was hoping to generate just the points I need.

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by phildunlap

        Hi Phillip,

        Of course there's a way! How simple is perspective. I would do it like this, using a script input, perhaps the global scripts

        var dataPoints = JSON.parse(JsonEmport.dataPointQuery("eq(name,Name Of Point)&limit(1000)")).dataPoints;
        
        for( var k = 0; k < dataPoints.length; k += 1 ) {
          dataPoints[k].templateXid = "NEW_TEMPLATE_XID";
        }
        
        JsonEmport.setImportDuringValidation(true);
        JsonEmport.doImport(JSON.stringify({"dataPoints": dataPoints}));
        

        Edit, if you only want the JSON, I would still retrieve that via a script output, like,

        print(JsonEmport.dataPointQuery("eq(name,Name Of Point)&limit(1000)"));
        

        If I had my druthers there would be a JavaScript console for this kind of thing, but alas one must validate it in scripts I guess.

        1 Reply Last reply Reply Quote 0
        • P
          Phillip Weeks
          last edited by

          Cool thanks Phil this seems like just what I need.

          P 1 Reply Last reply Reply Quote 0
          • P
            Phillip Weeks @Phillip Weeks
            last edited by Phillip Weeks

            it did work however I am noticing that the Unit is not stored in the PPT so is there a similar method to set all the units and other point attributes for named groups?

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by

              Yes, this method of data point editing is just like editing the JSON. So, there is a unit field on the data point, we can just assign the unit to it, i.e.

              var dataPoints = JSON.parse(JsonEmport.dataPointQuery("eq(name,Name Of Point)&limit(1000)")).dataPoints;
              
              for( var k = 0; k < dataPoints.length; k += 1 ) {
                dataPoints[k].unit = "Celsius";
              }
              
              JsonEmport.setImportDuringValidation(true);
              JsonEmport.doImport(JSON.stringify({"dataPoints": dataPoints}));
              
              1 Reply Last reply Reply Quote 0
              • P
                Phillip Weeks
                last edited by

                Perfect thanks Phil

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post