Services Plugins FAQs

CSV and ZIP in backend

Hi All,

First of all thanks for creating and maintaining all of the plugins!

I have been struggling however to get create zip and create csv (native) actions to the backend.

My issue is that my app needs to create ZIP files containing an array of .json and .csv files that are based on data in Bubble.

There are some nice solutions that help create all of the required files, however they are all front-end based. Do you have any solution in place that is working in the backend as well?

Thanks a million!

Hi @root,

Thank you so much for reaching out to us and for the kind words! We genuinely strive to provide our users with the highest quality products available on the market :pray:

I’ve checked the marketplace and our library, and I noticed that our plugins and all the others I tested are connected to an element, which prevents them from working on the backend. Unfortunately, I’m not aware of a plugin that can compress files into a zip fileespecially on the backend of the application.

Apologies for the disappointing news, but I hope you’ll be able to find a solution for your usecase. If you have any further questions, please don’t hesitate to let me know!

Best regards :sunflower:

Browse all Zeroqode Plugins for Bubble Banner_Last3

Thanks for getting back to me! Appreciated!

Too bad. You would have at least on user/client right away if you;d build one :wink:

Just started building one myself though as there is probably no alternative. Is there a community of plug-in developers that have a nice instruction about how to get a plugin up and running within the Bubble environment?

Cheers!

function(properties, context) {
    const JSZip = require("jszip");
    const zip = new JSZip();
    
    // 1. Parse inputs
    var folderData = JSON.parse(properties.folder_structure);
    var outputFileName = properties.output_file_name || "output.zip";
    
    // 2. Add files/folders to ZIP (same as before)
    function addToZip(currentZipFolder, data) { ... }
    addToZip(zip, folderData);

    // 3. Generate & upload
    return zip.generateAsync({ type: "nodebuffer" })
      .then(function(buffer) {
        return context.uploadFile(buffer, outputFileName);
      })
      .then(function(fileUrl) {
        // 4. Optionally update the Thing
        if (properties.thing_to_connect) {
          // The unique ID is often at _id
          var thingId = properties.thing_to_connect.get("_id");
          var thingType = properties.thing_to_connect.get("_type"); 
          // or you can pass it as a separate text input if needed
          
          // Build the data we want to patch on the Thing
          // For example, if your Thing has a "my_zip_file" field that is a "file" type:
          var dataToPatch = {
            "my_zip_file": fileUrl
          };
          
          // 5. Make an API call to Bubble's Data API to update the Thing
          // - We must do this asynchronously
          return context.async(function(callback) {
            // Example path: "/obj/[DataType]/[UniqueID]"
            context.request({
              uri: "/obj/" + thingType + "/" + thingId,
              method: "PATCH", 
              body: dataToPatch
            }, function(err, res, body) {
              if (err) {
                callback(err);
              } else {
                // once the patch is done, callback returning the file info
                callback(null, {
                  zip_file_url: fileUrl,
                  zip_file: {
                    filename: outputFileName,
                    private: true,
                    url: fileUrl
                  }
                });
              }
            });
          });
        } 
        else {
          // If there's no Thing, just return the file
          return {
            zip_file_url: fileUrl,
            zip_file: {
              filename: outputFileName,
              private: true,
              url: fileUrl
            }
          };
        }
      })
      .catch(function(error) {
        throw new Error("Error generating ZIP file: " + error.message);
      });
}

Hi @root,

Thanks a lot for your feedback. Unfortunately, we don’t have any plans to release a ZIP creator plugin on the marketplace right now :frowning:

However, you can reach out to the Bubble Forum - linked here - and see if anyone can provide you with more details about this feature and how to start building a plugin. The forum is very active with many developers and bubblers who usually provide more information and help others in need!

If you have specific questions about our plugins, please don’t hesitate to reach out to us here on the forum or at support@zeroqode.com!

Best regards :hibiscus:

Browse all Zeroqode Plugins for Bubble Banner_Last3

Thanks for the resonse, used o1 and built a working version today :slight_smile:

1 Like

Hi @root,

I’m thrilled to hear that you built it yourself! In the future, it’ll be more reliable since it won’t depend on another developer for changes you might want to implement!

Please don’t hesitate to reach out if you have any questions or concerns about our plugins. It would be a pleasure to chat with you :hugs:

Best regards :sunflower:

Browse all Zeroqode Plugins for Bubble Banner_Last3