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 use NOTLIKE query Filter ?

pshashipreetham
17-Peridot

how to use NOTLIKE query Filter ?

Hi,

I am using the following snippet, to Query on FieldName Which does not contain the "Test Question" Text in the FieldName Data

var query = {
   "filters":{
      "type": "NOTLIKE",
      "fieldName": "Name",
      "value": "Test question:\\+*"
   }
}; 


let params = {
	t: result /* INFOTABLE */,
	query: query /* QUERY */
};

// result: INFOTABLE
result = Resources["InfoTableFunctions"].Query(params);

 

Even though I get an INFOTABLE with rows containing "Test Question" in the FieldName "Name"..

Where did I do wrong?

Note: I have followed Query Parameter for Query Services (ptc.com) and Picked up the snippet from there

Thanks,

Shashi Preetham,
Email: psp316r@outlook.com,
Mobile: +91 8099838001.
ACCEPTED SOLUTION

Accepted Solutions

Try value as below,

var query = {
   "filters":{
      "type": "NOTLIKE",
      "fieldName": "Name",
      "value": "Test question*"
   }
}; 

View solution in original post

4 REPLIES 4

Try value as below,

var query = {
   "filters":{
      "type": "NOTLIKE",
      "fieldName": "Name",
      "value": "Test question*"
   }
}; 

Hi @Sathishkumar_C,

Thanks for the Quick response, but it is not working...

Thanks,

Shashi Preetham,
Email: psp316r@outlook.com,
Mobile: +91 8099838001.

Below code is working fine for me, I don't the list of values starting with "Audit"...  and ensure the field name once..

let params = {
	maxItems: undefined /* NUMBER */,
	nameMask: undefined /* STRING */,
	type: "Thing" /* STRING */,
	tags: undefined /* TAGS */
};
let entities = Resources["EntityServices"].GetEntityList(params);// result: INFOTABLE dataShape: RootEntityList
var query = {
   "filters":{
      "type": "NOTLIKE",
      "fieldName": "name",
      "value": "Audit*"
   }
}; 
let params1 = {
	t: entities /* INFOTABLE */,
	query: query /* QUERY */
};
result = Resources["InfoTableFunctions"].Query(params1);// result: INFOTABLE

,  

Always starts from the beginning, first I would check whether the "fieldName": "Name" really exists in the table. Pay attention to upper and lower case. If there is no name as a column, this is not taken into account here either.
Next I would test "value":  "%Test question%"  .
And if what you expect doesn't come out here, give a brobe with LIKE and see what comes as an answer now.

Announcements


Top Tags