Emmanuel Katto Uganda : What are the steps to use CSV streaming with a publicly accessible file?

Answered

Hello,

I'm Emmanuel Katto from Uganda, I'm currently working with a table called ImportFiles, which includes an attachment field (file) containing a CSV file. My goal is to use CSV streaming to iterate over this CSV file and import its records into another table called ImportLines.

Here's my current FunctionStack:

  1. Get ImportFile Record (varSelectedImportFile)

  2. Create variable: fileURL (varSelectedImportFile.file.path)

  3. Create File Resource (varFileResource)

    • Filename: Test.csv

    • FileData: fileURL

  4. Get File Resource Data (varFileResourceData) from varFileResource

  5. CSV Stream (varStream)

    • Input: varFileResource.data

  6. For Each Loop varStream as varItem

    • Stop and Debug: varItem

However, I'm facing an issue where the CSV stream appears empty. As a test, I added a fileResource input variable and found that the CSV stream works perfectly with it.

My question is: How can I transform the import file stored in the ImportFile table, specifically in the attachment field (file), into a usable fileResource that can be used effectively in the CSV stream?

Regards

Emmanuel Katto Uganda

2 replies