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

Get Most Recent Stream Entry Id

SizweMngadi
7-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

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

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

i would set maxItems to 1 to speed things up.

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

Yeah. That's Good.

Top Tags