Skip to main content
11-Garnet
November 10, 2023
Solved

How can I configure dropdown widget as data filter widget

  • November 10, 2023
  • 1 reply
  • 2331 views

Hi all,

 

I want to use dropdown widget as a data filter for my grid advanced widget data for that I created a Thing then an infotable property and a service to call that info table property and now in my mashup I added a grid widget and bind this service to grid data now I want to filter my data based on some criteria by using dropdown widget so how can I bind it like I tried to bind the same service all data property to the data property of dropdown and then in dispaly option of dropdown I selected the filter option  but I am not getting the result please help me how  I can bind properly or if any other way to filter the data

 

Regards,

Rayon

 

Best answer by Velkumar

Hi @Rayon_11 

 

If you are using New Grid (comes from 9.3), you can directly map the "SelectedText" property from Dropdown as Grid FilterString

 

Velkumar_0-1699611738682.png

So when data gets changed in the dropdown, grid will be filtered based on the dropdown value.

 

/VR

1 reply

Velkumar19-TanzaniteAnswer
19-Tanzanite
November 10, 2023

Hi @Rayon_11 

 

If you are using New Grid (comes from 9.3), you can directly map the "SelectedText" property from Dropdown as Grid FilterString

 

Velkumar_0-1699611738682.png

So when data gets changed in the dropdown, grid will be filtered based on the dropdown value.

 

/VR

Rayon_1111-GarnetAuthor
11-Garnet
November 10, 2023

Hi Velkumar,

I am using Thingworx 8.5 version

 

so how can I do this in this version

 

 

 

 

19-Tanzanite
November 11, 2023

Hi @Rayon_11 

 

Could you please tell me from where you are getting data for Grid?

 

Based on your use case, you need to create a custom service with a query to filter InfoTable Data. 

 

In my example, I'm trying to filter InfoTable Property. Please find below code for reference 

 

let result = me.dummyInfoTable; // DUMMY DATA
if (filterValue && filterValue.length > 0) {
	// Provide your filter using the format as described in the help topic "Query Parameter for Query Services"
	let query = {
		"filters": {
			"type": "And",
			"filters": [{
				"fieldName": "name",
				"type": "EQ",
				"value": filterValue // INPUT PARAMETER
			}]
		}
	};
 
 
	let params = {
		t: me.dummyInfoTable /* INFOTABLE */ ,
		query: query /* QUERY */
	};
 
	// result: INFOTABLE
	result = Resources["InfoTableFunctions"].Query(params);
}

 

 

Mashup Bindings

Velkumar_0-1699620882817.png

 

/VR