Skip to main content
4-Participant
August 31, 2021
Solved

DeleteStreamEntry service not work in Thingworx 9.0.4

  • August 31, 2021
  • 2 replies
  • 986 views

Hi team,

 

I tried to delete entry using built-in service DeleteStreamEntry given the entry id, but it looks like this service did not delete successfully, the entry is still there. Is this an issue or any workaround to resolve this problem?

 

a.PNG

 

Thanks.

Best answer by ShirishMorkhade_238755

Hello @LL_9777686 ,

You may want to try snippet like below.

for (var x = 0; x < tableLength; x++) {
	var row = streamEntriesForUser.rows[x];
	logger.info("streamEntriesForUser Rows :: " + row.id);
	Things["<Name_of_Your_Stream_Entity>"].DeleteStreamEntry({
		streamEntryId: row.id /* STRING */
	});
}

We wrote this snippet in TWX 8.5.3 and recently upgraded to TWX 9.2.1 and it works absolutely fine in both the environment. 

 

I am sure it will work for you with little modifications.

 

Regards,

Shirish

2 replies

16-Pearl
August 31, 2021

Hello @LL_9777686 ,

You may want to try snippet like below.

for (var x = 0; x < tableLength; x++) {
	var row = streamEntriesForUser.rows[x];
	logger.info("streamEntriesForUser Rows :: " + row.id);
	Things["<Name_of_Your_Stream_Entity>"].DeleteStreamEntry({
		streamEntryId: row.id /* STRING */
	});
}

We wrote this snippet in TWX 8.5.3 and recently upgraded to TWX 9.2.1 and it works absolutely fine in both the environment. 

 

I am sure it will work for you with little modifications.

 

Regards,

Shirish

Support
September 10, 2021

Hi @LL_9777686

 

If you found that the previous response was helpful, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon