Issue in Retool filedropzone component

I am facing issue with filedropzone component. At times, I get value undefined error. randomly it works.

I am building file upload app, file is stored in S3 Bucket, database in Supabase postgress db.

Firedropzone properties: Selectiontype: Single file, File type: ['jpg', 'png', 'pptx', 'xlsx', 'pdf', 'svg', 'docx', 'txt', 'csv', 'mp4', 'mp3', 'gif', 'zip', 'rar', 'doc', 'xls', 'jpeg']

To understand the issue clearly, i am passing the filedropzone value to a variable called varFileToUpload using change event property.

screenshort showing undefined value for a pptx file.

screenshot showing value is readable, eg. excel

I have test the same scenario using fileinput components but i get the same error.

Can you look into this issue and help me fixing.

Can you post the error? Perhaps your "varFileToUpload" code didn't complete before the API was called, resulting in varFileToUpload.value being undefined. Have you tried to create a code component that triggers these two processes serially?

@jg80 Thank you for the reply. The there was no error as all empty values directly post an unreadable file in s3 bucket.

As i am new to retool and no developer background. can you give me sample query first fetch value to VarFileToUpload then trigger the PostDocumentQuery?

There are probably lots of examples in the forums and many different ways, but generally you want to trigger a query like this from a button or event:

// wrapper to trigger sequentially
async function doInSequence() {
    await VarFileToUpload.trigger();

1 Like

thank you @jg80. Appreciate it.