User Tools

Site Tools


data_import

Data Import

There are two main methods for importing data into cuForms - (a) using the Manage Upload screen, or (b) using secure FTP to upload files directly to the cuForms server

Manage Upload

The Manage Upload screen allows you to import data directly into cuForms, using any of your form definitions as the file template. The upload file must be in .csv format with a header row, and the header row fields must exactly match the field descriptions in your form definition.

Once uploaded, the data can be used in the same way as data generated from user completed forms.

Secure FTP

You can also use SFTP to upload .csv files to cuForms. The filename must be in the format 99999.csv, where 99999 is the article_id of the form definition.

The system will continuously scan for uploaded files, and run the manage upload function automatically when a new file is discovered.

One simply way to use SFTP to upload files is from within an macro (see VBA sample code below). This will allow you to generate and upload a .csv file directly from an Excel spreadsheet. You can download the pscp.exe command line SFTP client from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

If you wish to use the SFTP upload feature, please contact cuForms for login credentials.

Public Sub SftpPut()
    Const cstrSftp As String = """C:\[filepath]\pscp.exe"""
    Dim strCommand As String
    Dim pUser As String
    Dim pPass As String
    Dim pHost As String
    Dim pFile As String
    Dim pRemotePath As String

    pUser = "username"
    pPass = "password"
    pHost = "hostname"
    pFile = Application.DefaultFilePath & "\99999.csv"
    pRemotePath = "/"

    strCommand = cstrSftp & " -sftp -l " & pUser & " -pw " & pPass & _
        " " & pFile & " " & pHost & ":" & pRemotePath
    Debug.Print strCommand
    Shell strCommand, 1 ' vbNormalFocus '
End Sub
data_import.txt · Last modified: 2017/02/20 16:50 (external edit)