Importing a CSV File

You can define an action for a button to import a CSV file for adding content to a table.

Prerequisites

  • You have created a model that contains a table.
  • You have created at least one column in the table and defined its data type.
  • You have a CSV file or text file that meets the following requirements:
    • The file is comma or semi-colon delimited.
    • The file must contain same number of columns as the table where you want to add the content.
    • The data type of each column in the file must match the data type of each column in the table.

Procedure

  1. In Layout view, select the Compose task panel.
  2. From the Basic Controls pane, drag and drop a button onto the table where you want to import content from a CSV file.
  3. Right-click the button, then in the context menu, select Action…
  4. In the Define Action dialog box, on the Actions tab, click the Add Action icon. In the context menu, select More, then select Import CSV.
  5. In the Action Properties area:
    1. In the To dropdown list, specify the table into which you want to import the CSV file content.
    2. In the Insert dropdown list, specify the location in the table where you want to add the CSV file content.
  6. Choose the Close button.
  7. To check the button that you added:
    1. In the Deploy task panel, choose the Deploy button.
    2. In the Deploy task panel, choose the Preview button.
      A new browser window opens with the model that you want to preview.
    3. Choose the new button that you configured in steps 1-6 to import a CSV file.
    4. In the Import: CSV File window, choose the Browse button to select the CSV file that you want to import.
    5. In the dropdown list under Set the CSV file delimiter, select Comma (,) or Semicolon (;).
    6. Choose the Upload button.
      The CSV file content that you imported appears in the table.