Why I can't download my xlsx that I created in my javascript code

I’m using the toolbox plugin and also a plugin to generate an xlsx file. I know that there are countless ways to transform a csv file into xlsx but unfortunately it couldn’t be like that in my project. the problem is that my code is not giving an error and it is not downloading xlsx either. I’m using a plugin to convert my list into json because I couldn’t convert it directly in the code. Could anyone help me with what I might be doing wrong? here are the prints:


image

I’m not familiar with this library, but most library will create the “file” but not trigger the download. At this point, you can choose to send the file data to an endpoint of use script to complete the download.
There’s probably some example to work in browser and generate a file download. This depend on the type of file created (blob, base64?..)

If you have a link to the library doc, share it and I can take a look

thank you so much for your reply! the link of the plugin that i’m using to make javascript code is this: Toolbox Plugin | Bubble

and the json file: JSON Generator Plugin | Bubble

and the library: xlsx - npm
i really appreciate all the help!

Sorry for the delay
according to the library doc, it’s should try to force download in browser. It may not be possible. But there’s a lot of thing to investigate to check if the script run correctly and after if the issue is the download. You can change the output type and use another library to force the dowload. But before that, you need to validate that the script is running. You should also move the script src (that you have in html element) into the page header I think.

This topic was automatically closed after 70 days. New replies are no longer allowed.