Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Reference unknown number of Images in a Form

Ideally, I would like to have one virtual column that would retrieve images from a table for reference when completing a form. I can select one image with one virtual column. I could add multiple virtual columns, but I don't know how many images will exist. Hopefully what I'm asking is clear enough.

ANY(SELECT(Inventory Attachments[Attachment Image],AND([Type]="Image",1=1,TRUE)))

DarenJanes_0-1663337110167.png

I try really hard to limit Virtual Columns, because I've read they are bad for performance. 

Appreciate ideas, I played with REF_ROWS but didn't seem to work. I need the images to be decent size.

Thanks,

Daren

 

Solved Solved
0 4 179
1 ACCEPTED SOLUTION

Oops, sorry.  That was my mistake.  The SELECT() needs to change so that it returns the row keys.  A Ref column means that you are supplying the "pointer" to a row or rows.  You can then "dereference" any column on that row to use in expressions.  But as in your case, it will be used to populate a view with a list of rows.

Slight modification to the expression like this:

SELECT(Inventory Attachments[Key column here],[Type]="Image")

Replace [Attachment Image] with the name of the column that is set as the key for the Inventory Attachments table.

View solution in original post

4 REPLIES 4


@DarenJanes wrote:

I try really hard to limit Virtual Columns, because I've read they are bad for performance. 

First, lets address this comment.  Virtual Columns are not bad for performance in general.  Where App Creators run into performance problems is when they use them un-wisely and unnecessarily.  Go ahead and use them when it makes sense to do so.  If you are unsure, then ask...just like you have today!

To your question...

I would recommend to use a Virtual Column, define it as "List" type with a base type of Ref, set reference table = "Inventory Attachments" and set its App Formula to the proper expression to select the images you want:

SELECT(Inventory Attachments[Attachment Image],[Type]="Image")

Side Note:  in your original expression you had inside the AND() "...1=1,TRUE...".  These do nothing and are not needed.

Add the Virtual Column to your Form.  By defining it as List/Ref, the form will shown an Inline table of the rows returned from the expression of the Virtual Column.

Since it sounds like you simply want to display descent size images for reference while filling out the Form, change the inline table view to a Gallery view.  To do that, got into the UX area, scroll all the way down to the bottom and tap the button that reads "Show system views"

Now scroll back up to the section for "Inventory Attachments".  You should see a view named "Inventory Attachments_Inline".  Edit this view, changes its type to "Gallery" and then set the properties of that view to display the images in the way that suits you best.

When you launch the Form, you see see a list of images and if many, you can scroll through them.

Caution...

A brief comment about WISE use of this Virtual Column of images.  If you expect a lot if images to added over time, then the expression as illustrated above would become very slow as that list grows and could severely impact performance.  This doesn't mean not to use a Virtual Column.  Rather it means you might need to find a way to keep the list small. You would want to make sure that the expression retrieves and shows only those images needed.

Thanks so much for helping me out with this. I think I've tried as you suggest, but I get stopped by the App Formula. It doesn't like the list of images matching a Reference.

DarenJanes_0-1663380358815.png

 

 

Oops, sorry.  That was my mistake.  The SELECT() needs to change so that it returns the row keys.  A Ref column means that you are supplying the "pointer" to a row or rows.  You can then "dereference" any column on that row to use in expressions.  But as in your case, it will be used to populate a view with a list of rows.

Slight modification to the expression like this:

SELECT(Inventory Attachments[Key column here],[Type]="Image")

Replace [Attachment Image] with the name of the column that is set as the key for the Inventory Attachments table.

Thanks. I finally got it to work as a reference. I'm just not happy with the result even after I changed the Gallery Inline view to Large image. I hate this solution, but for know I have 10 virtual columns brining back a maximum of 10 images. The Gallery View just messes with image format too much.

Thanks for all the help.

DarenJanes_0-1663457839992.png

 

 

Top Labels in this Space