We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Custom datasource api: avoid members call on some fields

Answered
Kevin asked on December 10, 2021

Hello,
we are using Flexmonster with custom datasource api but we have some issues.
We wish to not list all members for date and number fields. But if we don’t provide the values in the member api call, the pivot is just one line with the total aggregation. Is there a workaround to this behaviour?

15 answers

Public
Vera Didenko Vera Didenko Flexmonster December 10, 2021

Hello, Kevin,
 
Thank you for reaching out to us.
 
A possible reason for the issue you face could be the response structure that your server sends to Flexmonster. 
Could you please provide us with your set of request and response outputs (for /fields, /members, /select)? More insight will help our team to understand the situation better.
 
Thank you, and looking forward to your reply.
 
Kind regards, 
Vera

Public
Corentin December 10, 2021

Hello Vera,

Thank you for your response.

I send you some requests and response. We use Flexmonster version 2.9.9. We choose to implement custom datasource api version 2.8.22 and we disable advanced filters and hierarchical data.
The pivot have no issues with fields like account number. I can list the members and the pivot is what i expect. 

The issue comes from fields like desciption, documentDate,..
The screenshot is the result for the request in the Amount by Description output. I can't list all possible values for the description field but we want to be able to use it in a select request.

Public
Vera Didenko Vera Didenko Flexmonster December 13, 2021

Hello, Kevin,
 
Thank you for providing further details.
 
Please consider that the /members response is required: Flexmonster will only display those members that were present in the /members response. If an empty /members response is provided, then Flexmonster won't display any members. This means that Flexmonster will only display those keys in the /select response that match a member from the /members response.
 
If we understand correctly, in your case the list of members can change and this is why you can't provide all of the available unique members in advance. This causes an issue since the /members request is initiated only once when the field is selected for the first time.
 
If this is so, a possible solution would be to use the updateData() API call to refresh the data in Flexmonster when the members list changes. This will initiate a new /members request so you could provide a new list of members that are required for the current /select response.
 
Please let us know if this helps.
 
Kind regards,
Vera

Public
Corentin December 14, 2021

Hello Vera,

We don't understand why the /members request is mandatory.
As the /select request return all pivots cells, we thought that we didn't need to list the members.
The list of members of our fields doesn't change. For some fields, we can't provide an exhaustive list of members values.

 
Kinds regards,

Corentin.

Public
Vera Didenko Vera Didenko Flexmonster December 14, 2021

Hello, Corentin,
 
Thank you for your response.
 
Due to the current architecture, Flexmonster relies on the /members request for creating the required relationships between the data points and for providing filtering options for fields. 
 
Could you please explain in a bit more detail why for certain fields it is not possible to provide a list of members?
Also, to provide a bit more context, could you please let us know which data source type you are using (CSV, JSON, an SQL database (MySQL, PostgreSQL, ...), etc)?
Perhaps there is a workaround for your use case.
 
We are looking forward to your reply.
 
Kind regards,
Vera

Public
Ducarme Olivier December 20, 2021

Hi Vera,
 
Some fields of our flows are pure user input, as for example the "description" of an accounting movement. We take the assumption that, for a flow of 1 million movements, we will have 1 million distinct descriptions. We've therefore always considered that filtering this field using values doesn't make sense neither from a functional point of view, nor from an UX point of view (listing 1 million values is not usable).
 
So, even if we could list the values of this kind of field, we don't want to.  Those fields are therefore marked as "not filterable" in our system. They can just be retrieved and shown in our visuals, but not actively used to build a query.
 
We found the necessary options to do the same in the flexmonster custom datasource api, as part of the /fields response. As a consequence, we expected the component to *not* query the /members for those fields we mark as non-filterable on members (or at least the fields where all filtering options are disabled).
Our logic is this one:

  • The custom datasource API offers a great flexibility on listing fields, members of those fields, and filtering options, which is what we are looking for in the beginning.
  • On the other hand, we are then required to entirely build the result of the aggregation on server side (the /select request), and serve the front-end component with all cells values ready to be displayed "as is". We did not especially want to do that aggregation on server side at first, but we simply comply to the API.  We already discussed with you the possibility to keep the aggregation on front-end side in the custom datasource mode, but we understood it is not possible)
  • It was therefore quite a surprise to see that the values returned in the /select result were not displayed when the /members could not be listed entirely...  On one hand we have to serve the complete result of the aggregation, but on the other hand the front-end component still filters the result depending on the listed members.

You might have good reasons to explain this behavior. However, from the integrator point of view, we expect this behavior instead:

  • Do not query members of fields marked as non-filterable on its members. This is a loss of time and resources.
  • Trust the result given by the /select request and display it as it is, which is actually what is described in the API documentation
  • As a consequence, do not filter again the /select result based on the members of the fields present in this result

In order to have more details on the context of our integration, you can have a look at this former ticket, where we discussed about implementing the custom datasource api: https://www.flexmonster.com/question/is-there-a-way-to-specify-all-the-possible-values-of-a-hierarchy-beyond-what-cant-be-found-in-the-data/
 
As a workaround for now, we will always return "empty" values for those fields marked as "non-filterable". The user will therefore not be able to see the values of that field in the pivot configurator (bad), won't be able to filter it (good), and will only see the values when flexmonster is displayed using the "usual" mode (i.e. the server serves a JSON with all the data and the aggregation is done by the front-end component).  So only our "pivot configurator" is impacted by this limitation, but we would like to see with you if we can find a solution.
 
Thanks again for your time and expertise.
 
Olivier
 

Public
Vera Didenko Vera Didenko Flexmonster December 21, 2021

Hello, Olivier, 
 
Thank you for explaining the case in such detail.
 
Our team will need some time to investigate and research possible solutions.
We will reach out to you as soon as there are any updates, with the ETA 11th of January.
 
In the meantime, please feel free to contact us if any questions arise.
 
Kind regards,
Vera

Public
Vera Didenko Vera Didenko Flexmonster January 11, 2022

Hello Kevin, Corentin, and Olivier, 
 
Thank you for giving us some time to investigate the case in more detail.
 
Looking deeper, our team found a solution that will make it possible to avoid the /members response for those fields where filters are disabled. As a result, for non-filterable fields, Flexmonster will rely on the /select response to display specific members.
This update will be available in the upcoming minor release version of Flexmonster with the ETA 24th of January.
 
Please let us know if such a solution would work for you.
Looking forward to your reply.
 
Kind regards,
Vera

Public
Corentin January 14, 2022

Hello Vera,

Thank you for your investigation.

This solution seems a good improvement to us.
But what happens for the values of filterable fields that are in the /select but are not listed as members?
Does Flexmonster show the value contained in the select response? or the report line is missing as before?

Thank again for your investigation and your solution to our problem.

Kinds regards,
Corentin

Public
Vera Didenko Vera Didenko Flexmonster January 17, 2022

Hello, Corentin,
Thank you for your response.
 
We would like to explain that the update will only affect non-filterable fields. For filterable fields, it will still be necessary to list them in the /members response to be accepted as valid members and shown on the grid.
We will inform you as soon as the update is released (ETA 24th of January).
 
In the meantime, feel free to contact us if other questions arise.
 
Kind regards,
Vera

Public
Vera Didenko Vera Didenko Flexmonster January 24, 2022

Hello, Corentin,

We are happy to inform you that now for non-filterable fields the /members response is not required: instead, Flexmonster will read the members from the /select response.
In Flexmonster, you can make fields non-filterable either by returning filters.members: false in the /fields response from the server-side or by specifying filters: false via mapping from the client-side.
 
This is available in the latest (v2.9.17) minor release version of Flexmonster. You are welcome to update the component. Here is our updating to the latest version tutorial for guidance.
 
Please let us know if the update works well for you.
We are looking forward to your feedback.

Kind regards,
Vera

Public
Vera Didenko Vera Didenko Flexmonster February 7, 2022

Hello, Corentin,
 
Hope you're having a great week!
 
Just checking in to ask if you've had a chance to test out the mentioned update. Is everything working well on your side?
 
We are looking forward to hearing from you.
 
Kind regards,
Vera

Public
Vera Didenko Vera Didenko Flexmonster February 15, 2022

Hello, Corentin,
 
Hope you are doing well.
 
We were wondering if you had some time to test the update.
Is everything working well on your end, or is there something we can help you with?
 
Looking forward to your reply.
 
Kind regards,
Vera

Public
Kevin February 15, 2022

Hello Vera,
 
Thank you for your work ! Unfortunately, we have had no time to test your solution.
 
I will be happy to you let know when it's done.
 
Kind regards,
Kevin
 

Public
Vera Didenko Vera Didenko Flexmonster February 15, 2022

Hello, Kevin,
 
Thank you for the update.
 
We will be looking forward to your feedback.
If any questions arise, please feel free to reach out - we will be happy to help out.
 
Kind regards,
Vera

Please login or Register to Submit Answer