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

Accessing the data source after applying filters

Answered
Leonardo Santos asked on May 26, 2020

How to access Data Source after apply filters in Flexmosnter?
Example
dataSource (Origin)
[
      { name: 'Maria', age: 28 },
      { name: 'Jose', age: 26},
      { name: 'João', age: 22},
      { name: 'Ana', age: 24}
]
when the age filter greater than 25 is applied, accurate return of the data source with the filter applied, for example:
[
      { name: 'Maria', age: 28 },
      { name: 'Jose', age: 26},
]
it's possible?

3 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster May 27, 2020

Hi Leonardo,
 
Thank you for writing to us.
 
Please note that at its core Flexmonster is a data visualization tool rather than a data provider. Therefore, it is currently not possible to return the filtered data from the pivot table.
 
A potential workaround would involve using the exportTo() API call to export the currently viewed data to a CSV file. Feel free to read more on this by the following link: https://www.flexmonster.com/api/exportto/
 
Please let us know if this helps.
 
Best regards,
Mykhailo

Public
Leonardo Santos May 27, 2020

Hello Mykhailo,
 
Using the "exportTo()" function is it possible to have the return in JSON format?
Or for example to export only one column (ex: ID)?
with this column I can "assemble" a json with only the filtered data.
 
Best regards,

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster May 28, 2020

Hi Leonardo,
 
At the moment, the exportTo() API call only supports export to CSV, HTML, PDF, Image, or Excel.
 
This method also does not allow only exporting a single column – still, since it exports all the data that is visible in the pivot table at the moment, you can configure your slice to view one column at a time and use exportTo() after that.
 
That being said, do you think you could tell us a little bit more about your use case and what exactly you are trying to achieve in this situation? This will help us understand the whole picture better and see if there is anything more suitable that we can suggest.
 
Looking forward to your response.
 
Regards,
Mykhailo

Please login or Register to Submit Answer