Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
I am trying to used the scheduler but unfortunately my subscription not called for scheduler .Didn't get the exact solution while digging it.
Need help !!
Thanks in advance
Solved! Go to Solution.
Well, it depends on what you put in the timestamp field when you save data in that datatable.
One way to troubleshoot it is by opening this datatable in Composer and go to its Mashup -- this will give you a preview of what's inside.
Also try to wrap filters into an array, like this:
"filters": [{
Finally, in 90% of cases you should use Streams or ValueStreams instead of DataTables -- they are indexed by timestamp and thus optimized for such kind of queries. Your data table will start slowing your system down after it receives few thousands of records, which usually happens very soon.
/ Constantine
Hi @sagarmemane92.
I'm not clear on the issue. Can you please provide more details. Are you getting an error? Screenshots may be helpful.
Regards.
--Sharon
Hey Slangley,
I want to send the data automatically.I am using the data table .In service i am fetching the data and in subscription i am sending trying to send the data in html format through mail.But unfortunately my subscription not calling .I don't exactly error.(Script log- Error in: EMS_Scheduler_Sagar.Weekly_PF_Report javascript service)
Here I am attaching the service and subscription file
Thanks in advance
Sagar
Hello Sagar,
Here, in the very first line you should use "logger" instead of "Logger":
Logger.warn("Gandtay");
/ Constantine
Hey Constantine,
Its working . in there i need to change my HTML code little bit , So i will do that
Thanks For Help and quick response
Thanks and regard
Sagar Memane
Hi Constantine,
I have written below code to take the data daily,weekly and monthly ,but it doesn't work.It shows all the data of data table.
Can you help me in this
var days=7; // Days you want to subtract
var currentdate = new Date();
var lastDate = new Date(currentdate.getTime() - (days * 24 * 60 * 60 * 1000));
var day =lastDate.getDate();
var month=lastDate.getMonth()+1;
var year=lastDate.getFullYear();
var myquery =
{
"filters": {
"type": "Between",
"fieldName": "timestamp",
"from": lastDate,
"to": currentdate
}
};
var result = Things["ProductionLine_Data"].QueryDataTableEntries({
maxItems: undefined /* NUMBER */,
query: myquery /* QUERY */,
values: undefined /* INFOTABLE */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
});
Thanks
Sagar
Well, it depends on what you put in the timestamp field when you save data in that datatable.
One way to troubleshoot it is by opening this datatable in Composer and go to its Mashup -- this will give you a preview of what's inside.
Also try to wrap filters into an array, like this:
"filters": [{
Finally, in 90% of cases you should use Streams or ValueStreams instead of DataTables -- they are indexed by timestamp and thus optimized for such kind of queries. Your data table will start slowing your system down after it receives few thousands of records, which usually happens very soon.
/ Constantine
Hello @sagarmemane92 ,
/ Constantine
Hi Constantine,
Thanks For feedback ,
But i already did this changes.But still my subscription is not calling.Even in subscription Logger.warn("error); is also not working
I am attaching mu service and subscription here.
Regards
Sagar