4 Replies Latest reply on Mar 7, 2017 1:08 AM by ishrivastava-2 RSS
    ishrivastava-2 Newbie

    Query property History


    I have created a Thingshape which contains properties and it implemented by thingtemplate. I am creating 5 things dyanamically with implements this thing templates.These things implemented properties of thingtemplate and thingshape. I am updating properties by sending json data to each thing properties. Now i want to create the infotable which contains the last updated thing property at the top of table. Can anybody tell me how to get that? I have used query property history which is giving values of last created thing. But i want it to updated according to last updated property of any thing.

      • Re: Query property History
        pchung Collaborator

        Just using GetProperties or GetPropertyValues will get you that information.

        • Re: Query property History
          Ankit Gupta Ninja

          isha shrivastava, If I understand your query clearly. You can use GetImplementingThingsWithData for this requirement.

            • Re: Query property History
              ishrivastava-2 Newbie

              Thanks for the reply, GetImplementingThingsWithData  is used to get the current data updated in any of the thing properties. I have used QueryImplementingThingswithpropetyHistory so that I get the logged history data as well last updated value. But I m not getting the output when I used this into service. Can you suggest me what parameters are to be used to call this service.Or I should use some other service.

              var params = {
              oldestFirst: undefined /* BOOLEAN */,
              maxItems: undefined /* NUMBER */,
              endDate: undefined /* DATETIME */,
              nameMask: undefined /* STRING */,
              query: undefined /* QUERY */,
              maxDataItems: undefined /* NUMBER */,
              dataQuery: undefined /* QUERY */,
              startDate: undefined /* DATETIME */,
              tags: undefined /* TAGS */

              // result: INFOTABLE
              var result = ThingTemplates["TT_UKInS_Home"].QueryImplementingThingsWithPropertyHistory(params);