5 Replies Latest reply on Apr 5, 2016 3:08 PM by pchung RSS
    fgache Newbie

    Pass a paremeter of a row to a filter

    Hello everybody.

    I am currently filtering a stream of data with the "data filter widget".

    Here is my mashup.

    The upper part presents the list of my sensors, given by the service "get data table entries" in a grid.

    Below is the data filter widget where i need to enter the name of the sensor (device id) i am interested in (7427C in the example).

    The curve is based on a stream, whose measures are selected thanks to the data filter (if i had written 7428D in my filter, i would have had a completely other curve based on that sensor).

     

    That mashup is not very easy to use because i need to enter the name of the sensor to make the filter.

    I want that the selection of a row in the upper grid gives the information of the selected devide (device id) automatically to a filter, to make it more easy to use. Is there a way to customize a filter just by clicking on a row ?

     

    Thanks in advance for your help and your time.

      • Re: Pass a paremeter of a row to a filter
        pchung Collaborator

        This is covered in Thingworx Fundamentals and I highly recommend you go through that.

        You can pass selected Entity using Selected Row of the datasource.

        Since you are using a data filter I think you are already using QueryDataTableEntries so you can use that selected row 'Name' or 'Entity' and bind that to the Query Parameters of that Query.

          • Re: Pass a paremeter of a row to a filter
            fgache Newbie

            Actually, i cannot pass the "device id" that simply.

            I am using a "get data table entries" service for a table. When i try to pass the parameter on the filter, i can only bind it to "visible" :

            So i cannot use your solution.

            Maybe i did not understand something about what to do ?

          • Re: Pass a paremeter of a row to a filter
            qngo Creator

            Hi, I think you can bind directly the "GetDataTableEntries / Returned Data / Selected Row(s) / [device id] or [device name]" to the parameter of the service binded to the chart, or to a service which takes the deviceid as parameter and returns the stream after filtering the data.

              • Re: Pass a paremeter of a row to a filter
                fgache Newbie

                I cannot bind the device id to the service "query stream entries with data". I don't know why but no data binding except the one linked to the data filter is listed. And for the data filter, i am forced to type the name of the device each time i open the mashup.

                When you recommend using a service that takes device id as a parameter, do you have one specific in mind ? I could not find any that can address my problem.

                  • Re: Pass a paremeter of a row to a filter
                    pchung Collaborator

                    QueryStreamEntriesWithData has a parameter called Source - bind directly to the parameter.

                    I can't stress enough that I HIGHLY recommend Thingworx Fundamentals, it can be taken online as self-paced Web Based Training (WBT), Virtually assisted with an online instructor (VIAT) or as a live class.