How to copy an image from one table to another

How to copy an image from one table to another

pmarks906dpmarks906d Posts: 61Questions: 18Answers: 0

I have two embedded cloud tables where each one has a column that is of type image. For the purpose of discussion call these the source table and the destination table. In the source table I use the cloud table user interface to upload image files. When I hit a button I would like to get the image from the selected source table row, and copy that image to a new row being added to the destination table. The idea is to upload an image file (like a .jpg file) only once to the source file, and then be able to copy it to the destination file (multiple times to a different row each time) without having to re-upload it again. So far I can get the cell data from a selected image cell, and I can use editor.create().set() to assign the contents of a new row field, but I don't see how to combine the two. Is this possible?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,419Questions: 1Answers: 10,456 Site admin

    Sadly not yet. The closest would be to have a table of images and then create a "link" to that from the tables that can reference that image. That way there is only one image, but it does mean needing to have another table that is editable somewhere, since CloudTables doesn't yet to nested editing (another thing that is in the plan).

    Allan

  • pmarks906dpmarks906d Posts: 61Questions: 18Answers: 0

    Two questions:
    1. Is it possible to use Javascript to programmatically populate an image into a row having an image column?
    2. I'm trying to figure out if I could use a link between tables. I use a squarespace website which does not offer the ability to add server-side code. I am limited to what I can do on the client side with javascript and html. With this limitation can i create a direct link between two tables, such that multiple rows in the first table can link to a single row in the second table? for example, rows 1 and 4 in the first table might link to row A in the second table, while at the same time rows 2 and 3 from the first table could link to row B of the second table? In this way all my images could be stored in the second table, and multiple rows in the first table could link to those second table images, many to one. Is this possible?

  • allanallan Posts: 63,419Questions: 1Answers: 10,456 Site admin
    Answer ✓
    1. I'm not actually sure what you mean I'm afraid. It can't upload an image - that is a user action. It can set the value for a link, but your user would still need to select what value (image) is to be linked to.
    2. Yes - multiple rows from one table can link to another table. Think of i like this example - just instead of linking to a row that identifies a city, it would identify an image.

    The key limitation with the method I mentioned is that you'd need to embed a table of images into its own page (probably - you can technically have it on the same page as other tables, but I'm not sure about the UX flow of that). You'd upload the image. Then switch to the other tables and reference that image through the link.

    It is far from ideal - nested editing would be so much better for this, but unfortunately that is some way off in CloudTables.

    Allan

Sign In or Register to comment.