Skip to main content
1-Visitor
September 23, 2020
Solved

How to fetch date wise records

  • September 23, 2020
  • 2 replies
  • 2081 views

I have data in the JSON format.

I want to display records of the selected date and time on mashup for that, I have taken time selector widgets.

How can I fetch the data using the Time selector widget and how to display the result?

what service should be written?

how to use the time selector widget? Is there any other way to do the same?

 

  

 

Best answer by PaiChung

I'm a little uncertain, so I'll just state what I know.

The query you are executing as shown will take your initial infotable and produce a new one with the query applied.

I assume that will need to be your Service output of type infotable with the appropriate datashape assigned.

After that you can take the service map it to your mashup and display the output in let's say a grid.

 

Will this allow you to display all three shifts, I'm not sure because I don't know what your data looks like. Could it? Most likely, but you need to consider how users want to use the information and how to then display it, accordingly your services need to be created.

2 replies

22-Sapphire I
September 23, 2020

My guess is that you want data for a time range if you are using a time selector.

In a service

You'll have to convert your JSON data into at least an InfoTable first

Then you can apply the time ranges to it as a filter/query

That service is mapped to your mashup map in your input parameters from the time selector widget return result goes to your grid/chart

1-Visitor
October 5, 2020

Hello @PaiChung,

Thanks for your response,

I have converted JSON data into InfoTable.

I am taking input from the time selector and given as an input to my query filter as following:

// Provide your filter using the format as described in the help topic "Query Parameter for Query Services"
var query1 = {
"filters": {
"type": "AND",
"filters": [{
"fieldName": "timestamp",
"type": "BETWEEN",
"to": StartDate,
"from": Enddate } ] } };

 

So I need to give any service/conditions or I can directly pass this query to the infoTable?

I want to display shift wise records there are 3 shifts, do I need to use a time selector for that?

 

Regards,

Priyanka

PaiChung22-Sapphire IAnswer
22-Sapphire I
October 5, 2020

I'm a little uncertain, so I'll just state what I know.

The query you are executing as shown will take your initial infotable and produce a new one with the query applied.

I assume that will need to be your Service output of type infotable with the appropriate datashape assigned.

After that you can take the service map it to your mashup and display the output in let's say a grid.

 

Will this allow you to display all three shifts, I'm not sure because I don't know what your data looks like. Could it? Most likely, but you need to consider how users want to use the information and how to then display it, accordingly your services need to be created.

Community Manager
October 1, 2020

Hi @PriyankaDhangar.

 

If you are satisfied with the previous response, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Thank you for your participation in our community!

 

Regards.

 

--Sharon

Community Manager
October 13, 2020

Hi @PriyankaDhangar.

 

If you feel your question has now been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon