Hi Everyone:
First of all
the CSV import in livecloud is an awesome feature. , Can you show us if its accessible via command or code to do from the client side app? For instance , take the contacts app example.. A client would want to import his own data into his clients app.
It would also be cool to show how it can be done from a datagrid.
A note for people using MSExcel 2010 to generate .csv files : It errors , but if you upload the file to google sheets and then download it as a csv..it works wonderfully.
I'm not sure if its a purely 2010 excel version issue. Maybe later editions work.
Sid
Problem solved!
Mark and Efrain have fixed the issue and the improved API will be released soon that will solve imports from MSexcel csv files
For those of you needing do this in the meantime:
you can replace the semicolon of the header line with comma and it will work. This should only be broken in the header (line 1 of the text file). - MSExcel exports their headers with semicolons instead of commas. This is not the standard.
Well done on the quick response to my support request guys.
Sid
That is great to hear. Thanks for feedback.
04-17-2020, 04:40 PM
(This post was last modified: 04-17-2020, 04:43 PM by sid.)
Hi Efrain and Mark
I would like to request a small change on the csv import API. Its actaully the inclusion of a parameter to handle duplicates of records where you need to maintain a unique key .
For example a barcode. 2 different items should not have the same barcode. So its pretty easy to check for duplicates withing the livecode form and not allow the user to create a new record with a unique key, or ask them if they just want to update the record rather than create it
With the CSV import , it creates whatever records are in the CSV . Totally messes up your plans for keeping certain keys unique
So this is want I propose:
cdb_importCSV(pTable, pTarget, pPath, pUniqueKeys, pActionOnUnique)
The 2 new things will be : pUniqueKeys and pActionOnUnique
pActionOnUnique will be to either 'update' or 'ignore'
if it is 'ignore', then the import will disregard the duplicates
if it is ' update' it will update the keys of the existing records with whatever is in your csv
if you leave the parameter blank, then it does what the csv import usually does
pUniqueKeys will be the keys of whatever you don't want duplicated. For example "Barcode"
If a user uses the 2 extra parameters then please throw the Updated and Ignored records into 2 seperate arrays we can access, so we can inform the user what records have been ignored or what has been updated
This will be useful in a whole lot of scenarios , like importing data with ID numbers etc, you guys call them social security numbers, It is essential in accounting and stock software.
Thanks Guys
Sid
Hi Sid,
This a useful request; however, we are not able to work on it in the short term. Currently our team is focused on pushing for a beta release of Appli. Our goal is to have this available by the end of summer. We will come back to the APIs soon after the beta release of Appli.
I apologize if this is an inconvenience. If you'd like I can offer a work around for you in the meantime.
Best,
Efrain
Hi Efrain
Thanks man. I would really appreciate it if you can give us a workaround. a code example will be awesome
Also getting a blob into a row in a datagrid...Im struggling with that.
Good luck with the Appli beta.
Thanks again for the assistance
Sid