How to return File type data in element in Bubble plugin?

Search for a command to run...

No comments yet. Be the first to comment.
I have included all the information related to how you can build the Bubble plugin in this series. Check my course on how to build plugin from scratch- https://nocodetalks.co/bubbleplugin
There are many instances when you may want to create a plugin based on an existing Node.js library. For example, you might want to integrate a Node.js "encryption" library like crypto-js, or integrate the "squids" library to generate YouTube-like IDs...
Most websites use CSS :hover for hover effects. You can see them in the stylesheet, copy them, move on. Framer doesn't do that. Framer uses a React animation library (Framer Motion) with a whileHove

https://www.youtube.com/watch?v=63Lkpw8fGAw Introduction to Xano: A No-Code Backend Solution When it comes to choosing the right backend service for your project, Xano emerges as a noteworthy contender. This video explores the various facets of Xan...
Hi Everyone, This newsletter will be a little different from the ones before. In this edition, I'm excited to launch the Xano Cohort program, which I will be running. The program will start on May 6th for 6 weeks. Why I am starting this: Whenever I...

Learn what workload units are in Bubble, how they are calculated, and discover actionable strategies to optimize and reduce your app's workload units for better performance and cost efficiency. One think before moving forward- If you are reading thi...

There are instances when you may need to access an element created within the Bubble editor. For example, in a plugin, you might want to return the number of characters a user types into an input element. Follow these steps: Step 1: Enable the "Expos...

While making the "File-uploader" or any file-related plugin, you realize it's better to use the "File" data type instead of showing the "file-url" as text. Using the "File" data type instead of "file-url" has many advantages. For example, you can put the "File-name" and "File-url" in the same variable instead of making two separate variables. You can also directly save the "File" type data into Bubble DB.
But the real question is how to do it -
Follow these steps-
Step 1:
Create the variable type "File" as the exposed state-

Step 2:
Create a variable to hold the file URL (remember to add the "https" prefix if it's not already included) and then expose the variable.
var file_url = "https"+url_without_http;
instance.publishState("uploaded_file",file_url);
It will automatically expose the file-name too.
That's all for this blog. Subscribe for more future updates. Thank you!
Follow me on twitter.
Checkout My Bubble Plugin Course - Use coupon code "THEBUBBLEGROUP" at checkout for 10% discount.