Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Loading a saved report (local) seems to break the dataSource url to request data from

Kevin Ullrich asked on August 18, 2020


we are using elasticsearch and want to save/load the state of the grid. Report offers exactly that, however we have a problem:

Our dataSource setup:

dataSource: {
    type: ‘elasticsearch’,
    node: ‘elastic’,
    index: ‘index’,
    subquery: buildSubquery()

This works great on its own. It requests the data at our address ‘https://localhost/some/paths/elastic/index/_mapping’ for the mapping data. Perfect.

However, if we try to save the report and load it, instead of building the right url it wants to get the data from ‘http://elastic/index/_mapping’ which obviously doesn’t work. I’m not sure if this is actually a flexmonster issue or if I’m just lacking some javascript knowledge, but that’s an issue nonetheless. Is there a solution for this? And if not, is there a way to circumvent that? Simply including the whole address is not desired.

7 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster August 19, 2020

Thank you for reporting the problem.
The issue is going to be fixed with a minor update ETA Sep 21.
We will notify you as soon as the version with a fix is available to download.
Also, we want to explain the origin of the problem and propose temporary workarounds.
The requestHeaders property of the dataSource object is not saved with the rest of the report as described in our documentation.
It leads to the difference between the request URL depending on the presence of request headers. For example, in your case, the request URL is “https://localhost/some/paths/elastic/index/_mapping” when request headers are present and “http://elastic/index/_mapping” when they are absent.
After the fix, both cases will be treated equally, leading to the correct output: “https://localhost/some/paths/elastic/index/_mapping“.
As for now, we recommend considering using the full path to the data source.
Another option is to complement the report with request headers before it is passed to Flexmonster. For example, it is possible to manually load the report to the page, add the requestHeaders property to the dataSource object, and set the resulting report using the setReport API call.
We hope it works for you.
Please let us know in case other questions arise.
Kind regards,

Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 22, 2020

Hello, Kevin,
We are happy to let you know that the issue with composing request URL with headers was fixed.
This is available in the 2.8.16 version of Flexmonster:
You are welcome to update the component.
Here is our updating to the latest version tutorial for guidance.
Please contact us in case any questions arise.
Best regards,

Illia Yatsyshyn Illia Yatsyshyn Flexmonster September 29, 2020

Hello, Kevin,
Our team is wondering whether the recently provided fix managed to resolve the issue.
We are looking forward to hearing from you.

Kind regards,

Kevin Ullrich September 29, 2020

Oh, I’m sorry. I didn’t know you waited for a reply.

Yes! It works great now. Much appreciated!

Anjali Changale 20 hours ago

As per your update, I tried to save the report having request headers in datasource.
But after saving the report, the downloaded json file doesn’t include the headers, it only includes the api url.
Can you please confirm, how can I achieve this?
I want to pass the large amount of data as param to api url used as datasource. I can’t use the  GET api because of size limitation.
Please let me know ASAP.

Mykhailo Halaida Mykhailo Halaida Flexmonster 16 hours ago

Hi Anjali,
Thank you for writing to us.
Please note that the request headers not being saved to the report is the expected behavior – this is done for security purposes.
Regarding the second point, based on your question we assume you’re talking about passing particular parameters to your custom data source API instance. If so, we would suggest considering the cusomizeAPIRequest() API call, which allows you to customize the requests sent to the server for the custom data source API.
This, for example, allows you to set custom request headers containing information about the current user/session, which can then be used on the server to filter the data depending on the user. 
Please let us know if this applies to your use case.

Anjali Changale 15 hours ago

Thanks for the fast response.
Is it must to implement APIs at server side for “field, member and select” like CubeController. If yes, is there any other way?

Please login or Register to Submit Answer