Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hello,
I have a stream that I am attempting to add entries to by calling the .AddStreamEntries() method. I have tried passing two different infotables - one whose datashape is identical to the datashape on the stream which I'm trying to edit, and one which is defined by a new datashape, where I added the fields for 'location', 'tags', etc (to match more exactly with all stream fields).
Both methods throw a null pointer exception. I know that the infotable I'm passing it is not empty - already checked that.
Any ideas?
Things["MY_STREAM"].AddStreamEntries({
values: MY_INFO_TABLE /* INFOTABLE */
});
Solved! Go to Solution.
If anyone is reading this and looking for an answer, here's the solution:
You must pass in a timestamp to the .AddStreamEntries() method (in addition to the values, of course). You do not need to pass in a 'source' nor 'sourceType' - the service will still work. You actually don't even need to define a datashape for the infotable you pass in - you can just make an object directly.
Hard to say without more details on the Infotable contents you are adding and the Stream datashape. But for sure you need to fill standard parameters of stream: timestamp, sourceType and source.
If anyone is reading this and looking for an answer, here's the solution:
You must pass in a timestamp to the .AddStreamEntries() method (in addition to the values, of course). You do not need to pass in a 'source' nor 'sourceType' - the service will still work. You actually don't even need to define a datashape for the infotable you pass in - you can just make an object directly.