Get Free Trial

Export CSV with large number is not exported properly

Answered
raviteja asked on September 21, 2022

Hi Team,
When we export as csv, then the numbers are not correctly populated if it is more than 16-digits.
Please find that attachment. 
It works fine with other exports(Excel, PDF,HTML,Image)
 
Thanks,
Ravi

Attachments:
exportcsv.png

4 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 22, 2022

Hello!
 
Thank you for contacting us.
 
As far as we understand, the “Piece ID” field shouldn’t be recognized as a number by design.
With this in mind, we kindly suggest explicitly setting the “Piece ID” datatype to string using mapping. 
For that, add the mapping property to the DataSource object, and set the type to the field as follows:

dataSource: {
      ...
      mapping: {
            "Piece ID": {
                  type: "string"
            }
      }
}

We have prepared you a JSFiddle example for visualization: https://jsfiddle.net/flexmonster/enhmoqw6/.
You can find more details about mapping in our docs: https://www.flexmonster.com/doc/mapping/.
 
Could you please let us know if the suggested approach works for your case?
Looking forward to your response.
 
Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster 6 days ago

Hello, Ravi!

Hope you are having a great week.

Our team is wondering if you had some time to try the suggested approach and change the “Piece ID” type to string via mapping.
Could you please let us know if it works for your case?

Looking forward to hearing from you.

Regards,
Solomiia

Public
raviteja 5 days ago

Hi Solomiia, Piece ID actually mapped to String only, Because some times pieceid starts with JDT0037482882 something like that. T
he problem is when piece id contains only numbers it considered as number and format is happening and not able to get entire number
Any suggestions please.

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster 5 days ago

Hello, Ravi!
 
Thank you for getting back to us.
 
Kindly note that we haven’t managed to reproduce the described behavior with exporting the “Piece ID” field to CSV on our side. 
 
Could you please open your CSV file in any plain text editor(like Notepad or Wordpad) and take a look at the “Piece ID” there? 
The point is that according to the CSV format specifications, CSV files contain only plain text without formatting(you can read more about the CSV format here). 
Therefore, if you are opening your CSV file in Excel, as we can guess from the provided screenshot, the “Piece ID” could be exported from Flexmonster as a string but recognized as a number by Excel.
 
Could you please let us know if our assumption is true?
 
Looking forward to your response.
 
Kind regards,
Solomiia

Please login or Register to Submit Answer