cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Issue on stream (no value stream)

dbologna1
1-Visitor

Issue on stream (no value stream)

I All,

I created a new Stream 'TEST' form a DataShape like the following

I also created a service to store information in Stream by service AddStreamEntry().

With a service QueryStreamData() I saw all the rows stored into Stream.

I create a new service to get a subset of data from the stream using StartDate and EndDate but for both solution I didn't receceive return values.

FIRST TEST :

I set the date on the parameters like

var params = {

    oldestFirst: undefined /* BOOLEAN */,

    maxItems: undefined /* NUMBER */,

    sourceTags: undefined /* TAGS */,

    endDate: DateEnd /* DATETIME */,

    query: undefined /* QUERY */,

    source: undefined /* STRING */,

    startDate: DateStart /* DATETIME */,

    tags: undefined /* TAGS */

};

No output was  found, but there are into Stream  some data  between StartDate and EndDate.

SECOND TEST:

I creare a filter like

var date_start=DateStart.getTime();

var date_end=DateEnd.getTime();

my_query={

            "filters": {

                "type":"Between",

                "fieldName":"timestamp",

                "from": date_start,

                 "to":date_end

              }

         };

and put this into paramters like

var params = {

    oldestFirst: undefined /* BOOLEAN */,

    maxItems: undefined /* NUMBER */,

    sourceTags: undefined /* TAGS */,

    endDate: undefined /* DATETIME */,

    query: My_query /* QUERY */,

    source: undefined /* STRING */,

    startDate: undefined /* DATETIME */,

    tags: undefined /* TAGS */

};

Also in this case no output was found.

Please, anyone can give me some suggestions.

Many Thanks

BR

Dimitri

ACCEPTED SOLUTION

Accepted Solutions

Screenshot of result:

View solution in original post

4 REPLIES 4

Hi Dimitri Bologna​,

I just tested this scenario on ThingWorx version 7.4 and it works fine.

Here is my code:

var params = {

    oldestFirst: undefined /* BOOLEAN */,

    maxItems: undefined /* NUMBER */,

    sourceTags: undefined /* TAGS */,

    endDate: EndDate /* DATETIME */,

    query: undefined /* QUERY */,

    source: undefined /* STRING */,

    startDate: StartDate /* DATETIME */,

    tags: undefined /* TAGS */

};

// result: INFOTABLE dataShape: "undefined"

var result = me.QueryStreamData(params);

Could you please confirm the ThingWorx version you are on?

Hi Ankit,

many thanks for your answer.

I'm using the Thingworx 7.4

Now the service is working.

Maybe I had inverted the dates.

Sorry Ankit, is it possible to define a fixed ored of the parameters into Test mashup ?

Many Thanks

Dimitri

Things to check: select start date and end date in correct order. Sometimes end date variable show before start date and we select them incorrectly.

Output of the service is an infotable.

Screenshot of result:

Announcements


Top Tags