Importing CSV to Database

Certified Associate Developer

Hi,

I'm attempting to upload a CSV file to SQL server database on Appian V23.2

The database table has been an existing one for the upload process which was originally an Excel document which got converted to CSV within the process model.  We're in the middle of changing this to do straight upload of CSV file.

Issue we are having is that the CSV column names are produced from a third party site (Salesforce) and cannot easily rename the column names to match the database table names.

sample CSV Column names:

Opportunity ID# Account Name: Account Name Stage Opportunity Owner: Full Name

sample database table names

OPPORTUNITY_ID | ACCOUNT_NAME | STAGE | OPPORTUNITY_OWNER 

Using the "import CSV to Database" smart service, it seems that both have to match if the file is headered.  No ability to have different csv column names to that on the database, even if the number of columns match.  

Changed to java.lang.IllegalArgumentException: None of the columns from the CSV file matched the database table "ACO_STG_SALESFORCE_ORDERS"

I've tried setting 'File has Header' to true and leaving both 'Database Field Names' and 'CSV Header Names' blank but nothing is written to the table, no error returned either.  Similarly with 'Column Names'

Is there a way to import a csv file to a database table without having to manually rename the CSV columns to be that of the database? 

Thanks,

John

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Abhay Dalsaniya

    Hi Abhay,

    I appreciate the response but that isnt working.  Any combination of those 3 fields does not work unless the CSV has the same column names as the database table.

    This is not feasible for the upload which is daily as it comes from another source and we are trying to stop manual intervention in the file.  If it is not possible for the CSV to be headed with worded column names than the database table, then I will have to revert back to XLS or XLSX and convert that to csv.

    Thanks again.