Upload Data as CSV - Multifile Uploader vs Log File

I’m working on a site where clients will upload multiple CSV files - could be 100 or more. For this, I’m using the Multi-File Uploader - Dropzone. I don’t how many files the client will drag/drop into the uploader.

Just as a proof of concept, I set up a page where I only upload 3 CSV files. I use the Upload Data as CSV against each of the instances of the three files. So, I have three Upload Data as CSV actions and three Make Changes to a List actions because I’m adding two more fields to the target Type. This process works fine. Each CSV file contains ten data rows and a header row. The elements in the CSV file match the data fields in the Type.

To take the process further, I wrote a page that first adds the three files to a list of files in a Log file. Then, I use the Upload Data as CSV against each of the three instances in the list of files in the Log File. When I do this, I get the error message: "The column <?xml version=“1 does not match with a field on the chosen type.” The CSV files are exactly the same the ones in the Multi-File Uploader. The CSV column headers match the Fields in the target type.

Why would the Upload Data as CSV work when I point to the Multi-File Uploader, but not when I point to the list of files in the Log file? The CSV files are exactly the same.

My end goal is to write a recursive API Workflow that uploads as many CSV files as the client drags/drops on the Multi-File Uploader. But, I can’t do that right now because I can’t pass the contents of the Multi-File Uploader to the Workflow. I can pass the Log File that has the files.

I appreciate any assistance. Thanks

Greg

Multi-File does not check if your csv is valid (just check extention .csv). The format of your csv is not compatible with the download data. You need to be sure (external converter) that your csv files are of the correct format required by Upload Data.

Hi JohnMark, I understand that the Multi-File Uploader doesn’t check that the CSV is valid. But, I believe my problem is with the Upload Data as CSV process. If my understanding is correct, that’s where Bubble validates that the CSV matches the target Type.

I don’t understand how Bubble can upload a file when I point to an entry in the Multi-File Uploader, but rejects that exact same file (content and format) when the file is in a list of files within a Type.

By the way, I also uploaded the same CSV file using the Upload process in the Data tab of the Editor. The result is what I expected. The file format is fine.

Is there a restriction on the Upload Data as CSV action in which the file to be uploaded has to be in an element and not in a list of files in a Type? Or, is there some other explanation.

I hope what I’m saying makes sense. Thanks

Greg

Yes It make sense @greg3. The only restriction is the 100. I can’t find any issue, so you can maybe report as a bug, if the file is identical. But before, be sure the rights (privacy rules) are fine.

Hi JohnMark, I’m in early development mode for this web site, so I don’t have security set up. I couldn’t find any privacy or security setting on the Upload As CSV or other actions.

I’ve seen privacy settings on API Workflows, but I’m not there yet. Although I want to be. I want to create an API Workflow (using recursion) that will import as many CSV files as the client drops on the Multi-File Uploader.

I’ll open a bug.

Thanks

Greg

Greg

I developed a prototype for my requirement to upload multiple CSV files using a drag and drop and one click on a button. I used the Multi-File Uploader element along with an API Workflow on a List. Within the API Workflow, I used the Upload data as CSV action.

My client is able to drag and drop a selection of files on the Multi-File Uploader element, click a button, and come back a while later while the API Workflow does it thing.

Here are some details for the API Workflow:

  1. The Endpoint Definition for the API Workflow called “mfu-apiwf” has one Key that is “uploadfile” with Type as file and two other Keys with data that the site captures about all of the files that it uploads.
  2. Within the workflow:
    a. The first step is the “Upload data as CSV” with the file Key “uploadfile” from the Endpoint Definition as the CSV File.
    b. The second step is a “Make changes to a list” for the Type that accepts the CSV data with the List to change being the result of Step 1 and two data fields that populate the Type with the data passed to the Workflow.

On the Workflow for the Page:

  1. The most crucial step is “Schedule API Workflow mfu-apiwf on a List” with:
    a. Type of things as “file”
    b. List to run on as the name for the Multi-File Uploader element.
    c. API Workflow as “mfu-apiwf”
    d. Scheduled date as “Current data/time”
    e. Interval (seconds) as 2
    f. uploadfile as “This file”
    g. two other parameters that are drop down choices from the page.

That’s it. It took me a lot of digging around and help from the Bubble staff to get this to work. I thought there might be a bug in the Upload data as CSV, but there wasn’t.

Let me know if you have any questions.

Greg

This topic was automatically closed after 70 days. New replies are no longer allowed.