Has anyone any experience of having a virtual...

Has anyone any experience of having a virtual column that has an image? Iโ€™m working on an app that downloads and uses as specific table each time a member of a group joins/leaves. That file does not have an image column, so I want to add images to the table as a virtual column, but can figure out how to make it work.

Any helps is appreciated.

0 5 361
5 REPLIES 5

From where do you want to read the image(s)?

And why does it need to be a virtual column?

Sorry, I think I got it, you are unable to add an image column to the table you are reading data from. Interesting.

Yes, Stephen. Since Iโ€™m downloading the updates via a spreadsheet, the image column doesnโ€™t exist. So I want to be able to download the โ€œnewโ€ data without having to copy/paste into an old spreadsheet. I figured maybe if I had a virtual column that referred to an image, or perhaps an image table, so that an image of a person would show up. If that made any senseโ€ฆ

I had a similar need, and found a solution using a virtual column. Maybe it will work for you.

  1. Letโ€™s call your table โ€œMainTableโ€. You will need an additional back-end table where the images are stored, as you canโ€™t store anything in a virtual column. Letโ€™s call this table โ€œPicsโ€. Here, in addition to the key column, you need a column for the images, letโ€™s call it โ€œImageโ€, and a column that identifies the image, โ€œIDโ€. The values in ID will be copies of the values from the key column in MainTable, letโ€™s call it โ€œKeyโ€. Weโ€™ll set up the link between the tables inside AppSheet, so you donโ€™t have to manually copy over the values. Letโ€™s also use AppSheet to upload the images, this is faster and easier than copy/pasting images into sheets back-end.

  2. Import the Pics table, which is still empty, into AppSheet.

  3. Add a virtual column to MainTable, letโ€™s call it โ€œVirt Col Imageโ€. App Function:

=ANY(SELECT(Pics[Image], [ID]=[_THISROW].[Key]))

  1. Make sure that Virt Col Image has column type โ€œImageโ€.

  2. The two labels for MainTable should ideally be (1) the personโ€™s name; (2) Virt Col Image.

  3. In the Pics table, edit the ID column: Set the column type to ref, and in ReferencedTableName select MainTable. Set Valid_If to FILTER(MainTable, ISBLANK([Virt Col Image])). This creates a dropdown of people who still donโ€™t have images.

  4. MainTable will automatically get another virtual column added, called โ€œRelated Picssโ€. You can ignore this one, and mark it as Hidden.

  5. To upload the images, open the app on your PC (if the images are stored there). Open the form view for Pics and add a new row. The ID field will show the dropdown of people without images. Select one of them, and upload the image to the Image field. Repeat.

  6. The images will appear in Virt Col Image in MainTable.

Top Labels in this Space