I have a form that has a file attachment field. Some of the records in the form have attachments with the same name. They are not the same file. When I use export records, the CSV is created and the form-files directory is too. However, only one of the files is exported. The CSV file has the same name for both files. In Tap Forms I can see that the files are unique. So I am missing all the duplicated files in the export.
When attachments are added to Tap Forms, a unique name is assigned to each of the files that’s stored on disk. But internally Tap Forms keeps track of the original filename of the file you attached. This is the filename that’s used when exporting the CSV file.
I suppose I could generate a unique filename (by adding a numeric counter to the name). I’d also have to rewrite the filename that’s output in the CSV file too.
What is the purpose of exporting the files as a CSV file with the file attachments too? Just curious. Maybe using the Tap Forms Archive format would work better for you? If you’re sharing with other systems, then CSV is required. But if you’re sharing with other Tap Forms users or wanting to import into another Tap Forms document, then the Tap Forms Archive format is best.
Regardless of the purpose, it is not expected that unique records in database would be lost upon export. I am OK with the unique file name suggestion since I don’t really care about the file name; that is why I am using the database.