Need a special offer?Find out if your project fits.
+

Get Data

Answered
Jesus Jose Jurado asked on April 20, 2018

Hello again, I need your help ...
Once I loaded the data in the flexmonster table from a server (at the end point)
How can I get to load the same data but with different configurations without having to reload the data from the server.
My files (csv) are large, so I want to avoid recharging and because it has the same information

7 answers

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster April 23, 2018

Hello Jesus,
Thank you for your question. We have attached two configuration files as an example. Both of them are referring to the same sales.csv data file. However, when you load the first one and after that the second one you can notice that the data was loaded only for the first report. The second one does not require loading the data, it applies the configuration on the same data. You can open Network tab in the developer's window of your browser and check that there was no sales.csv loading process for the second report. The key idea is to have the same dataSourceType and filename properties in the reports.
Please let us know if it works for you.
Regards,
Dmytro

Attachments:
report1.json
report2.json

Public
Jesus Jose Jurado April 23, 2018

Ok, But the URI that I set to filename attribute changes because we use a SAS token in the query string and we need to refresh it when it expires and that does not means that the report has changed.

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster April 24, 2018

Hello Jesus,
Thank you for your feedback. Our component does not compare the data sets. Therefore, it implies that the same data source filename leads to the same data and if it was changed, then the data was also changed. In such case, you can try making a proxy URL which is not changeable and leads to the URL which uses query string. Also, there is an alternative approach. If you cannot create proxy URL please consider the idea of changing only the configuration and not data. For such case, you can try our API calls such as runQuery()setOptions()setFormat(). Such approach allows changing only the configuration and not reloading the data. Please find the list of all available API calls with the examples in our documentation: https://www.flexmonster.com/api/.
Let us know if it solves the case.
Regards,
Dmytro

Public
Michael T May 24, 2022

Is this response still valid? Will having two reports with same dataSourceType and filename prevent it from requiring the same file twice? would this work to save bandwidth for a multi-fm dashboard?

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster May 24, 2022

Hello, Michael!
 
Thank you for your question.
 
For this approach to work correctly, the first request needs to be cached before all the following would try to load the data. You can use the reportcomplete event to achieve such behavior.
 
We have prepared a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/5ac9kbtf/.
To ensure the second data request is cached, open the dev tools(press F12), go to the network tab, and run the example.
 
Please note that this approach would work only for CSV/JSON datasource. 
Could you also specify your data source? It would help us to give you more relevant suggestions in the future. 
 
We hope it helps. Looking forward to your response.
 
Regards, 
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 2, 2022

Hello, Michael!

Hope you are doing well.

Our team is wondering if you had a chance to try the suggested caching approach. Could you let us know if it works for your data source?

Looking forward to hearing from you.

Regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster June 9, 2022

Hello, Michael!

Hope you are having a great week.

Just checking in to ask if the suggested caching approach was helpful for your case.

Looking forward to your response.

Regards,
Solomiia

Please login or Register to Submit Answer