Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
brtdvrs
2 years agoHelpful | Level 5
i want to check is file exists with async/await
I tried this but it doesn't work: async function CheckIfFileExist(dbx, fileName) { let fentries = []; dbx.filesListFolder({ path: "" }) .then(async function (response) { fentries = await respons...
brtdvrs
2 years agoHelpful | Level 5
I just have to look in de root for the file. That’s not the problem. My call comes back undefined and not true or false because the await response does not work.
Greg-DB
Dropbox Community Moderator
2 years agoThanks for clarifying. It sounds like the issue is more around how async/await itself works in JavaScript. I can only really help with the Dropbox API/SDK in particular, so I recommend referring to a guide/documentation for async/await in JavaScript.
That said, it seems like "await response.result.entries" may not be what you want. Perhaps you mean to await the API call itself?
Also, "fentries > 1" doesn't seem to make sense. I suspect you meant "fentries.length >= 1" instead.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!