5 Replies Latest reply on May 3, 2016 2:53 PM by raghun RSS
    srudenkov Newbie

    Query all implemented thing with filter

    I have such thingShape:

    name: STRING

    report: TEXT

    internalThing(ccr): Thing Name

     

    I would like to Query all implemented things that doesn't have internalThing.

    I tried QueryAllImplementedThings service of my Template

    Selection_035.png

    I don't see any negative predicates.

      • Re: Query all implemented thing with filter
        pchung Collaborator

        You may need to use a custom Service

        if you look at the Query parameters available: Query Parameter for Query Services

        There is NE, NOTLIKE, NOTIN

          • Re: Query all implemented thing with filter
            srudenkov Newbie

            Pai Chung, thank you for answer. Could you, please, be more specific about where I should pass my query code?

            Lets say I have chosen thise code to be my filter:

            var query = {
                 filters: {
                      type: "MissingValue, NotMissingValue",
                      fieldName: "OrderQuantity"
                 }
            };

            Should I pass it as String into "query" param of QueryAllImplementedThings? Should I implement my own service for it?

            Thanks in advance!

              • Re: Query all implemented thing with filter
                srudenkov Newbie

                I created service GetPRwithoutCCR with corresponding code inside:

                var query = {

                    filters: {

                        type: "EQ",

                        fieldName: "name", value: "AAA"

                    }

                };

                 

                result = query;

                Selection_038.png

                But I am proceeding get all implemented things without applying filter. What am I doing wrong?

                  • Re: Query all implemented thing with filter
                    pchung Collaborator

                    The data being filtered is the result coming back from QueryImplementingThingsWithData not your own GetPRWithoutCCR service.

                    So if your GetPRWithoutCCR is the right service, then the Query has to be passed into that service and applied to the recordset within that service.

                     

                    If QueryImplementingThingsWithData is at the basis of that service, then invoke that server side within GetPRWithoutCCR applying the query at that time and then moving on from there to produce the proper output.

                    Right now you are calling each service individually and they are returning their own recordset to the client.

              • Re: Query all implemented thing with filter
                raghun Newbie

                Are you invoking the QueryImplementingThingsWithData after your Query service runs ? If not then QueryImplementingThingsWithData service may be running with an empty input query as it is being triggered before or at the same time as your query service...  check if invoking it after solves your problem !!


                For brevity I think its always good  practice to follow what Pai suggested in a prior reply.