Convert Image URL to Image

Is it possible to convert an Image URL to a static Image file hosted by Coda?

@Scott_Collier-Weir suggested we can use modifyrows() to accomplish this, but it’s not working for me.

Here’s the Doc I’m using this in. And here’s the button formula I’m using: ModifyRows(thisRow, thisRow.Image, thisRow.[Image URL])


There is a way to do this. It requires creating a pack with a sync table. The sync table will consume the image URL (as a parameter for syncs) and return a new row with an image attachment. Within the sync table code you’ll have to download the image and upload it to temporary blob storage, to return the result as a “temporary” Coda-hosted URL that Coda will then permanently host on its servers upon the sync.

Unfortunately that’s the only way to make Coda download and host the file.

Sure, you’ll have to come up with a mechanism to be able to keep adding files. You should allow passing multiple URLs for a sync at once, turn on the “Keep removed rows” (so that when you update the sync parameter, old rows with previously hosted files don’t disappear), and also have a feedback loop from the sync table to the “upload URLs” table to prevent passing the already consumed URLs into the sync table.

I did this once for a client and have a pack at hand; PM me if you’d rather purchase the solution than build it yourself.

The original solution @Jon_Dallas proposed still works for getting Coda to host the images, they just forgot to convert the column to text.

If you edit your ModifyRows and add .ToText() to the image URL column, it’ll work,

ModifyRows(thisRow, thisRow.Image, thisRow.[Image URL].ToText())

1 Like

Thanks so much @Micah_Lucero and @Paul_Danyliuk!

@Micah_Lucero, your solution does work, nice one!

But, actually attempting to use this to render imgix-composite images into static. @Paul_Danyliuk I actually think this would be exactly your wheelhouse!

The idea is that I could incrementally render the imgix images as to not be bound by the 1 single-line text, 1 blend, and 1 mark (technically you can nest imgix images, but only 3 deep).

Any ideas @Paul_Danyliuk? Do you think the pack workaround you suggested would do the trick?

Thanks for your help!

No way! I stay corrected then.

The thing I was solving for that client was different anyway. He wasn’t trying to codahost a public image, but codahost a coda-generated SVG, convert it to raster, and include it in an email to send to their customer. That’s why I did the roundtrip to the pack, I guess — to host the SVG from Data URI. Not sure if the same trick would work with just copy-pasting image content into the upload cell.

@Jon_Dallas my Edit Images Pack implements a trick that ups the number of images that can be combined up to 5. I’m basically abusing the image+blend+mark to apply ‘layers’ recursively: image is a transparent base, blend is the recursive result, and mark is the new layer so that it’s always on top. Then it’s the imgix URL length limit that kicks in. It’s a hidden formula in that pack because I wanted to extract it into a separate pack and make it minimally paid, but I never had the time to. There are no instructions really but this short demo video:

But yeah, it seems that with the trick of copy-pasting the URL to the upload column you can flatten and rehost the resulting images right in Coda without a pack?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.