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

Get Most Recent Stream Entry Id

SOLVED
Bedrock

Get Most Recent Stream Entry Id

I would to ask if there is anyone that knows how to retrieve the auto generated id value of a value stream entry using a service

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Get Most Recent Stream Entry Id

var params = {
	oldestFirst: false /* BOOLEAN */,
	maxItems: undefined /* NUMBER */,
	sourceTags: undefined /* TAGS */,
	endDate: undefined /* DATETIME */,
	query: undefined /* QUERY */,
	source: undefined /* STRING */,
	startDate: undefined /* DATETIME */,
	tags: undefined /* TAGS */
};
// result: INFOTABLE
var data = Things["AlertHistoryStream"].QueryStreamEntriesWithData(params);

result = data.rows[0].id

View solution in original post

3 REPLIES 3
Highlighted

Re: Get Most Recent Stream Entry Id

var params = {
	oldestFirst: false /* BOOLEAN */,
	maxItems: undefined /* NUMBER */,
	sourceTags: undefined /* TAGS */,
	endDate: undefined /* DATETIME */,
	query: undefined /* QUERY */,
	source: undefined /* STRING */,
	startDate: undefined /* DATETIME */,
	tags: undefined /* TAGS */
};
// result: INFOTABLE
var data = Things["AlertHistoryStream"].QueryStreamEntriesWithData(params);

result = data.rows[0].id

View solution in original post

Re: Get Most Recent Stream Entry Id

i would set maxItems to 1 to speed things up.

Is there a particular reason why you need to know the id?

Re: Get Most Recent Stream Entry Id

Yeah. That's Good.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________