cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to get output from a data filter widget

Tomellache2B
14-Alexandrite

How to get output from a data filter widget

Hello, community,

 

I am trying to filter my stream using the data filter widget. I wrote a service that outputs values from my stream. I've bound all data from the stream to the data filter widget. Took the query property of the widget and bound it to the grid. Then took the querychanged event from the widget to invoke my customer service.

 

On runtime, I can query using my filter but the result (filtered data) does not appear on my grid. It only shows the number of rows that have been filtered. Please see the screenshot below. 

filter.png

How can I solve this? I used this tutorial: https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Mashup_Builder/Widgets/ChipBasedDataFilterWidgetThemable.html

 

Many thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
nmutter
14-Alexandrite
(To:Tomellache2B)

The service "which outputs values from your stream" needs to accept a query parameter, which it will use when querying the stream data.

See in your video at https://youtu.be/LHmXjLBsrsE?t=69

nmutter_0-1663701334981.png

 

The query is passed to the grid, and the grid passes it to the QueryDataTable service. So the service which you are using to currently get all data needs to apply the query and return only the matching entries.

 

So the filtering is done in the Backend, needing a new service call each time the user changes its query.

 

View solution in original post

2 REPLIES 2
nmutter
14-Alexandrite
(To:Tomellache2B)

The service "which outputs values from your stream" needs to accept a query parameter, which it will use when querying the stream data.

See in your video at https://youtu.be/LHmXjLBsrsE?t=69

nmutter_0-1663701334981.png

 

The query is passed to the grid, and the grid passes it to the QueryDataTable service. So the service which you are using to currently get all data needs to apply the query and return only the matching entries.

 

So the filtering is done in the Backend, needing a new service call each time the user changes its query.

 

Tomellache2B
14-Alexandrite
(To:nmutter)

thank you @nmutter. This worked

I created a custom service that queries my stream and returns the desired columns. What was missing was adding an input of type query and passing this input to the query parameter of queryStreamEntrieswithData.

Top Tags