File Upload not working when part of dynamic elements

Hey there!

I am currently having issues with file-uploads. This is both with the default file-upload as well as the UI-Kit “Drag & Drop” file-upload component.

I am allowing my admin users to create custom form templates for non-admin users to fill-out:

screen_recording

The form template created above is then used to generate an interface for the non-admin user to enter data:

screen_recording2

So, each of the elements that the admin added to the template makes a new Flexbox in data entry form. If the Input Type = ‘Text’ then show a short answer input to the user, if numeric show numeric input and so on… The entered data is added to a variable with corresponding keys, and for each inputs a trigger On change modifies the value for the appropriate key.

My issue is that, because the file-upload input is a reactive/dynamic Element to repeat, it does not take in any file. I tried both the normal file-upload and the one from the UI-Kit.

I know nothing of JavaScript, but I have attempted to name my file-upload input getFile and fetch it via JavaScript as per the WeWeb Documentation, but it doesn’t work.

screen_recording3

As you can see in the workflow, the action Upload file does not detect that there is a file input element there.

When the user enters data, it is added to a user_input key in the corresponding array index, which I can then submit to Xano as a filled-out form.

image

How could I store the uploaded file’s url into my variable for submission? I don’t even know where to grab it.

Apologies for the long post, and thank you in advance for your help!

1 Like

I think you have the same problem as me Error uploading file directly to xano bypassing Weweb's CDN

can’t detect the file element but the other comment helped me.

use this to grab the element:

wwLib.getFrontDocument().querySelector(‘#file input’)

Thanks! At first glance, that might have been it, but I get the following error when trying to use it.

image

I played around, but not knowing more about wwLib and their functions makes it harder to troubleshoot…

This is happening to me as well, were you able to solve it?