hello
how is it possible to read the values from the console?
I use the Cloudinary upload widget which returns the saved image url to the console, how can I read it?
hello
how is it possible to read the values from the console?
I use the Cloudinary upload widget which returns the saved image url to the console, how can I read it?
I try to explain the problem better, I use a Cloudinary widget for uploading images, (using run jscript of the toolbox plugin).
when the image is uploaded to Cloudinary in the browser console the url of the image is written.
How can I retrieve this url to archive it?
I ask you for help
Hi anyone can help me?
You don’t need to read the console, but to modify the script. Actually the widget use console log to show the result, but you can replace this part of the script using what you wan’t. You can choose to use toolbox to get the url in a state or you can send the url to a backend WF endpoint for example.
Thanks for response!
excuse my English. Did I understand that it is better to modify the script and send the result directly in bubble? right? but unfortunately I do not know how to do more with an example to advise me
you say to send url to endoint of the workflow right?
Yes you can do whatever you wan’t in the widget that will fit your needs.
<button id="upload_widget" class="cloudinary-button">Upload files</button>
<script src="https://upload-widget.cloudinary.com/global/all.js" type="text/javascript"></script>
<script type="text/javascript">
var myWidget = cloudinary.createUploadWidget({
cloudName: 'my_cloud_name',
uploadPreset: 'my_preset'}, (error, result) => {
if (!error && result && result.event === "success") {
console.log('Done! Here is the image info: ', result.info);
}
}
)
document.getElementById("upload_widget").addEventListener("click", function(){
myWidget.open();
}, false);
</script>
The result.info in the console log function is the result that you need to get back in Bubble.
there’s no plugin for Cloudinary?
unfortunately I have not found plugins for cloudinary. But I’m fine with changing the widget, I just don’t know how to do it
(err, result) => {
if (!err) {
console.log(result.event);
console.log(result.info.secure_url);
bubble_fn_urlCloudinary=“provatesto”;
console.log(bubble_fn_urlCloudinary);
}
});
}
this is the piece of the script where it writes to the console how I can send result.info.secure_url to bubble instead?
Did you try bubble_fn_urlCloudinary=result.info.secure_url ?
I guess that the bubble_fn_urlCloudinary is the function you are using with the toolbox?
but the variable returns nothing
[image]
but the console yes
and like it couldn’t pass the value from jscript to bubble despite the plugin
I think the problem is that you need to send the value / trigger the toolbox function only if th event is success.
I don’t use the toolbox plugin (in most case I will instead create my own plugin). So not sure how it work. But I’m pretty sure that one issue actually is that the function is triggered on every event add a if before the function to check the event type == “success”
and like it couldn’t pass the value from jscript to bubble despite the plugin