🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all hot features!
Get Free Trial

How to import local CSV/JSON file to flat form with all field shown

Answered
Felix Tan asked on June 1, 2021

Hi, 
I want to import a local CSV/JSON file to flat form with all fields shown automatically, how can i do so?
 
I only manage to set it to flat form using setOptions. Is there any method i can use to get all the field? 
 
Follow the order as in CSV file if possible. Thank you

2 answers

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster June 1, 2021

Hello, Felix,

Thank you for posting on our forum.
 
We suggest configuring the global object which has the same structure as the Report Object. Specify the desired form in the options property. This configuration will be applied for all the following files and reports if the specific parameter is not overwritten.
Here is a JSFiddle for the demonstration: https://jsfiddle.net/flexmonster/yzoq5a9u/.
 
All the fields will be selected by default when using the flat form. If a more specific selection is required, use the Slice Object.
The order of fields will be the same as in the CSV file. Alternatively, use the flatOrder property of the mentioned slice object to define the desired order.
 
Please let us know if it works for you.
Looking forward to hearing your feedback.
 
Kind regards,
Illia

Public
Felix Tan June 2, 2021

Hi Illia,
Yes, this is what I wanted.
Thank you very much for your assist and fast response.

Please login or Register to Submit Answer