Wappler Version : 1.9.0
Operating System : Windows 10
Expected behavior
Importing a text file where some fields contain no data should not affect other records
Actual behavior
Subsequent records are affected - values which should be inserted are not inserted.
How to reproduce
I have a server action which imports a tab-separated text file into a MySQL database. There are 28 fields, including several numeric fields. In a number of cases fields may not necessarily contain data. To prevent MySQL errors in the case of numeric fields, I add a condition like this:
A customer has been using a similar import process on a website for several weeks and I haven’t heard of any problems. The relevant table in this case contains about 6000 records.
I was testing this import on some test data for another customer and was surprised that many records didn’t contain a value in the price field. I checked the data - there was one record from a total of about 500 which didn’t contain a price. I checked the file for anomalies and imported it directly into the database using Navicat - all the data was imported correctly.
It seems that if Wappler comes across a Null value in a numeric field (I’ve tested with float and int), no data from the following rows will be inserted. Here is the same data imported with Wappler (left) and Navicat (right):
The relevant part of the server connect action file is:
I would be grateful for any idea. This feature is critical for most sites I develop.
Last updated: