I don’t know javascript, but I’m trying to learn it to solve this problem. I wondered if anyone may be able to point me in the right direction with this question? I’ve been struggling with it for days!!
I’m trying to use the Toolbox plugin to trigger a Bubble workflow when the result of the event is a “success”. How would I approach that with the following code?
I think this part is pertinent but I don’t know to incorpate something like “bubble_fn_success(“success”);” into the code in order to trigger the workflow.
Put the JavaScript to Bubble element on your page and follow the documentation to set it up. Give it a suffix of “close” for example.
Enable the “trigger event” checkbox.
In the workflows tab add a workflow “when a JavaScript to Bubble event is triggered” → do whatever actions you need like closing a popup etc.
Back in your script try:
if(result.event===“success”){bubble_fn_close()};
Then elsewhere in that script define the function:
function bubble_fn_close(){return}
I think that should work - the function gets called and doesn’t do anything however the plugin should register the event and trigger the workflow at point 3 above.
This page serves as a way for users to be able to upload video. After that’s successful, they’ll be taken to another page, which is why I was trying to get this working to trigger that event.
However, because users upload the file directly through the browser and it’s uploaded to Cloudinary for storage (as opposed to into Bubble database/AWS and then to Cloudinary) I’m running into this problem where I’m trying to figure out how to store some kind of unique identifier for the file and create a database entry for that user so that when the file is uploaded, I know which file to retrieve from Cloudinary on the next page (or in the future). Otherwise the upload modal disappears and I have no idea what the video file is!
Any thoughts on how to approach that? Does that makes sense? Either way, I appreciate your help from before.
Like I said, I’m not a developer, so I’m trying to figure this all out of the fly. I think it may be the public_id, but I don’t exactly know how to go about this in Bubble + with javascript: Upload API Reference | Cloudinary
OK awesome, I didn’t know you could see that in the console. But how do I specifically structure that in the script to focus on say the “public_id” parameter?