How do I pass a FileUploader element’s URL to an API Connector call in a workflow? The value is arriving as null when I try to use FileUploader A’s value’s URL in the API call body. What’s the correct way to capture and pass a file URL from a FileUploader to an external webhook?
✦ AI
The most likely reason you’re getting null for FileUploader A's value's URL in your API Connector call is timing: the file upload isn’t always finished by the time your workflow tries to use its URL. Here’s how to make sure you’re capturing and passing the file URL correctly:
How to do it:
- Trigger the workflow only after upload is complete
- In the Workflow tab, use the event “When FileUploader A’s value is changed”. This event only fires after the file has finished uploading and Bubble has the file’s URL.
- Don’t trigger the API call from a button click unless you’re sure the upload is done.
- Reference the file’s URL in the API call
- In your API Connector action (in the workflow), set the relevant parameter or body field to:
FileUploader A's value's URL - This will be the full S3 (or storage) URL of the uploaded file.
- If you need to trigger from a button (e.g., “Submit”)
- Make sure the file is uploaded before the button is clickable. You can do this by:
- Disabling the button until
FileUploader A's valueis not empty. - Or, show a loading indicator until the upload is done.
If you’re still getting null:
- Check the workflow event: If you’re using “When Button is clicked”, and the file is still uploading,
FileUploader A's valuewill be empty or null. - Check privacy rules: If you have privacy rules on the File data type, make sure the current user is allowed to see the file’s URL.
- Check the API Connector call: Make sure you’re referencing the correct dynamic value in the body/parameter field.
Summary of steps in Bubble UI:
- Go to the Workflow tab.
- Add a new event: Elements → An input’s value is changed → FileUploader A.
- Add an action: Plugins → Your API Connector call.
- In the API call’s body/parameter, use:
FileUploader A's value's URL.
If you need to use a button:
- In the button’s workflow, add an “Only when” condition:
FileUploader A's value is not empty - Or, disable the button until the file is uploaded:
In the button’s “This element is clickable” property, set:
FileUploader A's value is not empty
Less likely, but possible:
- If you’re using a multi-file uploader, you’ll need to use
FileUploader A's value's URL:first itemor loop through the list. - If you’re using a custom file upload plugin, the property name might be different.
Let me know if you’re triggering the workflow from a button or another event — that’s usually the key detail here.