Save image retrieved from URL

Hello,

I have an issue with saving images that are retrieved from a URL:

In particular, I have to generate a barcode through barcodesinc.com (example: https://www.barcodesinc.com/generator/image.php?code=1c7e0d8a&style=197&type=C128B&height=50&xres=1&font=3) which takes an ID generated by Appsheet and includes it in the URL which then returns an image.

Now, I’m storing this image in an “Image” column, and would seem to work (I see the picture of the barcode when I’m still editing the row in the app). The thing is, when the row is added to the table, I have a workflow that creates a PDF which includes some of the columns of this row, including the barcode. But, the barcode doesn’t seem to show up on the PDF! Rather, a blank box shows where the barcode should be, which is clickable and sends me to the URL that it saved. Furthermore, it did seem to work once, some time ago, so it should certainly be possible, but I do not know what has changed (lot of things have changed) since then unfortunately. Does anyone have any ideas?

Best regards

Try to use googleapis…

@Viktor
Is your column (where you store that barcode image) a physical column in your back-end gSheet or a virtual column?

@LeventK The column is a physical one, stored in the backend sheet, and just contains the URL that returns the image

@Viktor
Remove that physical column from the back-end, regenerate your column structure and create a Virtual Column of Image Type and in the Content property of this column, use a CONCATENATE expression:

CONCATENATE(
    "https://www.barcodesinc.com/generator/image.php?code=",
    [YourColumnName],
    "&style=197&type=C128B&height=50&xres=1&font=3"
)

and simply refer to this Virtual image column in your PDF template:

<<[Virtual_Image_Column_Name]>>
1 Like

@LeventK Thanks for the swift reply. I’ll let you know how it goes

You’re welcome, truly my pleasure

@LeventK That seemed to solve the problem! Thank you. Any ideas why a physical column doesn’t work? Just out of curiosity

@Viktor
Virtual Columns are re-computed on each sync. The workflow action and the creation of the PDF is a quick action and when you use a physical image column where the content is HTTP based, than it’s a time-consuming work to fetch that image from web to the template and therefore it appears as blank. As a point; the issue is not the same provided the physical image column’s content is residing in the appsheet app’s gDrive designated folder. With using the Virtual Column, you always have the image in your app. The cons of this is you need to sacrifice from the app’s sync time a bit (but not much for sure).

I appreciate provided you mark my reply post as the solution as other community members might benefit from that if-and-when they search the post archive with the solution tag. Thanks.

1 Like