4 Replies Latest reply on Apr 27, 2017 6:29 AM by ad'orso-2 RSS
    ad'orso-2 Newbie

    QueryImplementingThingsWithData

    good morning

    I need to take some of the thing properties that are associated with a thing template.

    I use QueryImplementingThingsWithData as shown below.

    But in this way I get all the properties instead of me interests only one specification.

    Can someone help me?

     

    Example

     

    Var params = {

    MaxItems: undefined / * NUMBER * /,

    NameMask: undefined / * STRING * /,

    Query: undefined / * QUERY * /,

    Tags: undefined / * TAGS * /

    };

     

     

    // result: INFOTABLE dataShape: RootEntityList

    Var list = ThingTemplates ["ThingTemplate"]. QueryImplementingThingsWithData (params);

     

     

    Thank you

      • Re: QueryImplementingThingsWithData
        supandey Collaborator

        Antonio, for further filtering on the data returned are you using the Query with that you can include AND/OR to filter out the result

         

        Matches or NotMatches filter

        var query =

        {

            "filters": {

                "type": "Matches|NotMatches",

                "fieldName": "Source",

                "expression": "(Kettle)|(Filler)"

            }

        };

          • Re: QueryImplementingThingsWithData
            ad'orso-2 Newbie

            Thank you for your answer.

            Ok i know this feature

            But I'm interested in taking all the values of the "fieldName": "Source"

            Without "expression":

            But if I do not write the expression goes wrong

            And I also need to have the data of two fieldName" different

            How can I do?

              • Re: QueryImplementingThingsWithData
                Ankit Gupta Ninja

                Antonio D'Orso,

                 

                Per my understanding; you can either remove the columns using: InfotableName.RemoveField(fieldName);

                Or create a new InfoTable and copy the required fields in that Infotable by using Infotable for loop snippet.

                  • Re: QueryImplementingThingsWithData
                    ad'orso-2 Newbie

                    Thanks Ankit

                    Ok,so I get the result.
                    But my request was due to the fact that using the QueryImplementingThingsWithData that returns all of the property values I believe is a waste of resources.
                    For example if I have 100 things linked to the thing template with 100 properties, but these only affect me two, the QueryImplementingThingsWithData service will return 10000 values instead of the 200 affected values.
                    So I was wondering if I can only extract the properties I'm interested in directly with the QueryImplementingThingsWithData service.