Skip to main content
1-Visitor
April 23, 2018
Solved

Get Most Recent Stream Entry Id

  • April 23, 2018
  • 1 reply
  • 1956 views

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

Best answer by Sathishkumar_C
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

1 reply

17-Peridot
April 28, 2018
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
22-Sapphire I
April 30, 2018

i would set maxItems to 1 to speed things up.

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

17-Peridot
May 1, 2018

Yeah. That's Good.