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 get rows with blank datetime fields in an infotable

Willie
16-Pearl

How to get rows with blank datetime fields in an infotable

I'm trying to get rows in an infotable that have empty datetime fields.  The following is the code for the query, but I'm unable to get any results.  When I log the values of the empty datetime fields with logger, it says the value is undefined.  I've tried using various falsy values as the value, but it did not work.

 

	let query = {
		"filters": {
			"type": "EQ",
			"fieldName": "SomeDate",
			"value": "" // <--- have tried various falsy values (false, 0, -0, "", '', null, undefined, NaN)
		}
	};
	result = Resources["InfoTableFunctions"].Query({
		t: result /* INFOTABLE */ ,
		query: query /* QUERY */
	});

 

ACCEPTED SOLUTION

Accepted Solutions
Willie
16-Pearl
(To:Willie)

Solved.  I was able to get the rows with empty datetime fields using the query parameters below:

 

let query = 
{
    "filters": {
        "type": "MissingValue",
        "fieldName": "SomeDate"
    }
};

 

More query parameters here:

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx/Help/Composer/Things/ThingServices/QueryParameterforQueryServices.html

 

View solution in original post

2 REPLIES 2
Willie
16-Pearl
(To:Willie)

Solved.  I was able to get the rows with empty datetime fields using the query parameters below:

 

let query = 
{
    "filters": {
        "type": "MissingValue",
        "fieldName": "SomeDate"
    }
};

 

More query parameters here:

http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx/Help/Composer/Things/ThingServices/QueryParameterforQueryServices.html

 

slangley
23-Emerald II
(To:Willie)

Hi @Willie.

 

Thank you for sharing your solution with the community.

 

Regards.

 

--Sharon

 

Announcements


Top Tags