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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How to write service to search the data present in the collection widget through textbox?

Ru
14-Alexandrite
14-Alexandrite

How to write service to search the data present in the collection widget through textbox?

Hello,

i have one collection which have some infotable data, now i want to search that data through textbox.

How i write the service to search any column or row data present in the collection widget? if i write "99898" in textbox then it should give me data related to "99898" or if i write "ABC" then it should give me data related to "ABC". please suggest the code which i can use for this.

1 ACCEPTED SOLUTION

Accepted Solutions
BABA-SHYAM
14-Alexandrite
(To:Ru)

Hi,

 

You can use something like this. 

Bind the Filter event to the service that is triggered when searching begins:
If you are using a data table, bind the Filter event to QueryDataTableEntries service.
If you are generating data through a data service, bind the Filter event to the data service.
The following example shows a search query that searches for an event, Rain, in all columns:
{"maxItems":100000,"query":{"filters":{"type":"OR","filters":[{"fieldName":"id","type":"LIKE","value":"%Rain%"},{"fieldName":"date","type":"LIKE","value":"%Rain%"},{"fieldName":"max_temp","type":"LIKE","value":"%Rain%"},{"fieldName":"min_temp","type":"LIKE","value":"%Rain%"},{"fieldName":"cold","type":"LIKE","value":"%Rain%"},{"fieldName":"visibility","type":"LIKE","value":"%Rain%"},{"fieldName":"wind","type":"LIKE","value":"%Rain%"},{"fieldName":"precipitation","type":"LIKE","value":"%Rain%"},{"fieldName":"events","type":"LIKE","value":"%Rain%"},{"fieldName":"image","type":"LIKE","value":"%Rain%"},{"fieldName":"key","type":"LIKE","value":"%Rain%"},{"fieldName":"location","type":"LIKE","value":"%Rain%"},{"fieldName":"source","type":"LIKE","value":"%Rain%"},{"fieldName":"sourceType","type":"LIKE","value":"%Rain%"},{"fieldName":"tags","type":"LIKE","value":"%Rain%"},{"fieldName":"timestamp","type":"LIKE","value":"%Rain%"}]}}}
 
Regards
Shyam

View solution in original post

1 REPLY 1
BABA-SHYAM
14-Alexandrite
(To:Ru)

Hi,

 

You can use something like this. 

Bind the Filter event to the service that is triggered when searching begins:
If you are using a data table, bind the Filter event to QueryDataTableEntries service.
If you are generating data through a data service, bind the Filter event to the data service.
The following example shows a search query that searches for an event, Rain, in all columns:
{"maxItems":100000,"query":{"filters":{"type":"OR","filters":[{"fieldName":"id","type":"LIKE","value":"%Rain%"},{"fieldName":"date","type":"LIKE","value":"%Rain%"},{"fieldName":"max_temp","type":"LIKE","value":"%Rain%"},{"fieldName":"min_temp","type":"LIKE","value":"%Rain%"},{"fieldName":"cold","type":"LIKE","value":"%Rain%"},{"fieldName":"visibility","type":"LIKE","value":"%Rain%"},{"fieldName":"wind","type":"LIKE","value":"%Rain%"},{"fieldName":"precipitation","type":"LIKE","value":"%Rain%"},{"fieldName":"events","type":"LIKE","value":"%Rain%"},{"fieldName":"image","type":"LIKE","value":"%Rain%"},{"fieldName":"key","type":"LIKE","value":"%Rain%"},{"fieldName":"location","type":"LIKE","value":"%Rain%"},{"fieldName":"source","type":"LIKE","value":"%Rain%"},{"fieldName":"sourceType","type":"LIKE","value":"%Rain%"},{"fieldName":"tags","type":"LIKE","value":"%Rain%"},{"fieldName":"timestamp","type":"LIKE","value":"%Rain%"}]}}}
 
Regards
Shyam
Top Tags