Return a file from Plugin Action

Plugin > Action: Sever-side action type.
I’m using the library: qr-image to create QR codes.
I want the plugin to be part of a backend workflow. I will pass a url to the workflow to generate a QR code of the URL.

I can generate a SVG string and write that to my Bubble database. But I want to create a png file and write that to the database. I’ve attached a screenshot of my action editor.

How can convert the SVG string to a png file then return it to the backend workflow? Maybe I’ve gone about this the wrong way so I welcome any suggestions.

Many thanks.

try this… Save return value in db or show on image element.

Ankur@ Nocodetalks
Helping Bubble Devs to build No-Code Products. Follow me on Twitter

1 Like

Thank you, this solved it! EDIT: partially solved, see subsequent question requesting alternative URL format

Interestingly, the saved image is not viewable when I click ‘see’ using the database record viewer; a blank browser window opens. I assume this is because the image URL is data:image… I’m hoping image will be usable in the backend workflow.

Many thanks

Unfortunately, I’m having trouble using the qrcode image in subsequent workflows. I referred to the image opening a blank browser when I clicked the ‘See’ option in the database record viewer (even though there is an image of the qrcode in the preview. I suspect this is a problem.
I need a url for the qrcode png that can be used in Airtable. I’m writing the qrcode to Airtable and the Airtable attachment field will only accept a URL. It rejects the data:image/png;base64… url created with your suggestion.
Is there a way to save the qrcode file as a png on the amazon s3 service that Bubble uses to store files?
Here’s a typical URL of the type that i need:
https://s3.amazonaws.com/appforest_uf/f1654030177854x266736443522336300/create-qr-code

Thanks for your help with this, I’m very grateful.

Do this-

homeurl is “website home url”

Ankur@ Nocodetalks
Helping Bubble Devs to build No-Code Products. Follow me on Twitter

1 Like

That’s got it!

For completeness, I added “.png” to “test” in the payload.

Many, many thanks for your help with this.

1 Like