Import xls/xlsx

I would look into zapier or integromat and find a third party tool to handle the conversion from there before returning the resulting file in your application.

Happened what I wrote above. I exported xlsx file in unicode.txt but forgot to resave the txt file in utf8 format.txt. This caused an error. Thus, we can consider this a temporary solution, but in the future we will still have to look for a solution for the project and integrate it, because already now I foresee how the client swears about the fact that his employees are constantly suffering with imports…

I also have a question about a strange situation related to imports.

Here’s the file I’m importing: newtest4.zip (1.6 KB)

All its values are normal:

For some reason, when importing, the value of the first column of the first record is zeroed. All other values are imported normally. And all subsequent entries have no problems either:

What is the reason for this and how to solve this problem?

It has a BOM at the start of the file, that is probably causing the zeroed first record since the import script doesn’t handle that correctly.

And how can this problem be solved?

Try this update, place it in dmxConnectLib/modules. It should detect the BOM and skip it if found.

import.zip (917 Bytes)

2 Likes

@patrick could the BOM be impacting this?

Cannot import column 1 of CSV

That is possible, try with the new import script if it is solved.

1 Like

Yes. Now the import is carried out correctly. Thank you for your timely help!

PS It would be great if in the future Wappler could support importing more formats, not just csv and xml. Because these formats are used mainly by advanced users or site administrators. If we are talking about ordinary users, then these formats are not familiar to them. They use the more familiar formats xls/xlsx, pdf, doc/docx, etc. As a result, it turns out that now with the help of Wappler it is impossible to make a service aimed at a wide audience of users, in which data import from users is widely used, if you do not use third-party services or libraries.

I know of services which are aimed at very large audiences (thousands of users) where standard formats - eg xml, tab-separated or CSV - are the only options. I would have thought this is the most common/typical situation and offering Excel import would be unusual. (I wouldn’t have thought there would be any point or use in offering Word or PDF import option.)

I appreciate your point about the difficultly users might have in following the procedure you outline - surely this is an example of what Excel macros and VBA are for?

2 Likes

Or, because they are not familiar with them, you’ll need to educate them. Consider back when CVV came out. Nobody knew what it was, so every site accepting a credit card added instructions on where to find it—some with tooltips, some with pictures, etc.

The reason csv works across so many platforms is because of its simplicity. There are no versions to deal with and no proprietary formats.

Educating people on File > Save As > CSV seems very doable and well within any excel users ability.

1 Like

An xls file is more then just some spreadsheet. It contains a workbook with multiple worksheets. It contains formulas, styles, charts, metadata etc.

Also xls is not an open standards, it is a proprietary binary format from Microsoft.

This does not negate the fact that there are many services that in addition to csv support xls/xlsx format. Why? Because regular users are much more likely to use xls/xlsx than csv. Many people do not even know what csv is.

I don’t think that’s a valid comparison. In the case of a credit card, there is no alternative to using a CVV code. Therefore, if the user wants to pay for the purchase on the site by credit card, he is forced to specify the CVV code, regardless of which site is located.

With data import, the story is different. If I offer the option of importing only in csv format, there are a dozen alternative services that offer a similar service, but with support for importing in xls/xlsx format.

If the user maintains data using characters outside the ASCII standard (this is very, very, very many people around the world), he can not just save the table in csv, because the data in this case will be distorted. In this case, it needs to do the conversion procedure to the appropriate format with the correct encoding. And these are additional steps. An ordinary user is essentially a consumer, if you do not have a unique service, he will simply close the browser window and open the site of an alternative service that supports everything necessary for simple operation.

I perfectly understand your logic based on the technical side of the question. I would like you to understand my logic based on customer focus and UI / UX development. In this vein, it is necessary to follow the principle of no counterbalance - no need to explain to the user how to do, if you can do as the user wants.

As Patrick said xls is a closed binary proprietary format from Microsoft. So even if we want to we can’t and are not allowed to use it.

Yep, that is a tough one. How about an external Excel to JSON converter?

I have to admit there seems to be a massive shift to using google sheets instead of microsoft excel these days and google sheets seem to very easily import excel files.
Maybe try just as a test taking your excel file with its special character set into google sheets and then exporting to cav from there just to see if it removes a step in the process.
If it does then see what options are available in the google API for sheets.

I have recently tried out (https://sheety.co/) which can turn any google sheet into an API. I have then been able to pull the data into Wappler using the API source tool quite easily.

Wonderful name :joy:

2 Likes

Why not write an Excel Macro for this client?
You can code it or record the export to CSV.

@sid can help with this - we have imported xls and xlsx using couple libraries on couple projects.